Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Layout Template Restrictions #7715
I've created a custom content type (Promotion Landing Page) that has a LayoutPart. I'm looking to create another content type (Promotion Landing Page Template) that will allow users to create and reuse templates specifically for the Promotion Landing Page.
I see that the LayoutPart already has a "Use as Template" option, which works well. However, we'd like to restrict our Promotion Landing Page content items to allow Promotion Landing Page Template content items as templates. The current behavior seems to be that once a LayoutPart is marked as "Use as Template", then it's a valid template for all other LayoutParts.
Would there be interest in allowing restricting the template to only be allowed for specific content types? I'd be happy to develop this feature and submit a pull request, but I want to get input from the community before doing so.
Here are two ideas I had for the design of this feature:
There would be a bit of maintenance the user would have to do when adding a new layout-based content type, in some cases. With Design 1, adding a new layout type may require the user to add the new type to the list of allowed types on any restricted template types. With Design 2, adding a new template type may require the user to add the new type to the list of allowed template types on any restricted layout types.
Once again, I'm looking to hear from the Orchard community to see if this is a feature that would be worth adding to the Orchard.Layouts feature and get your thoughts on design before I move forward.