Hi Katharina,
If you share Pagetype1 and Pagetype2 across all sites, this functionality isn't supported through the standard AvailableContentTypes attribute. If you want to use AvailableContentTypes, you could consider adding additional content types to each site that extend your current types and simply set different AvailableContentTypes attributes on each class. You'd have to convert existing content to the new types, which is a bit of a headache, but it would allow you to use the attribute.
Alternatively, you would have to implement your own ContentTypeAvailabilityService, which is the service that Episerver calls when it renders the interface of available types during content creation. The recommended approach is to make your own implementation of this abstract class, implement GetSetting / ListAvailable / IsAllowed and register it on the IoC container for usage instead of the default implementation. You can implement custom logic for filtering down the types based on the current site context.
Here is an example Mattias Olsson put together that does something similar to what you are trying to achieve, although it overrides the default implementation (DefaultContentTypeAvailablilityService), which isn't recommended since its internal / could change at anytime.
Hope this helps,
/Matt
Hello,
My customer has using epi 10 and they have three sites that using the same root. For example
Root
Then Site 2 and 3 not allow to create Pagetype3. How I could do that in programmatically?
Thanks!
/Katharina