Created by: Brandon Kelly ([email protected]) on 2015/03/06 03:54:45 +0000
Votes at time of UserVoice import: 32
It would be nice if it was possible to restrict Structure sections' entry types to certain levels.
For example, on a section like http://buildwithcraft.com/docs, where there is are "Heading" and "Documentation Page" entry types, it would be nice if there was a way to restrict the top level to just Heading entries, and all other levels to just Documentation Page entries.
I agree! It feels weird that all structure levels use the same entry type by default, because in most cases they will need different fields...
Either add an option to set a default entrytype for each level, or the option to restrict entry types to certain levels. Or a combination of both ;)
This is a much-needed feature for my company as well. Here's an alternate solution that I think is conceptually simple and offers a lot of flexibility (taken from how ProcessWire handles things): If you could set an entry type to only allow certain other entry types underneath it (or vice-versa: entry types could be set to only be allowed underneath other entry type(s)), then you could do all sorts of things...
For example, if I have an employee directory and my entry types are "Employee" and "Department", I want each employee to be in 1 and only 1 department. I could set the section to only allow "Department" entry types at the top-level, then set the "Department" entry type to only allow "Employee" entries as children. (Or maybe it's vice-versa... saying that an entry type can only be a child of some other entry type, so a "Department" cannot be a child of any other type, and "Employee" can only be a child of "Department" entry type).
But if I have a more complex structure (to take an example from a real project I'm working on): I've got product categories and products. Categories can be nested, but products must be under 1 category (and a category either has sub-categories or sub-products, but not both). So I could have 3 entry types in this section: "category that has subcategories", "category that has products", and "product", then set each of them to only allow the children of the proper type (and set "product" to not allow child entries at all). In this way I can have an arbitrarily-nested structure (I don't have to set it to a specific number of levels) but also enforce the hierarchy I want.
@jordanlev Thanks for the feedback! Setting allowed entry types based on parent/child relationships sounds much nicer than restricting per level. Could you post this as a new "issue" though? It鈥檚 more likely we鈥檇 implement your idea, and it would be nice to link directly to it in the changelog.
@brandonkelly done, thanks for listening :)
I know you can't commit to any dates, but as a general question... are all new features going into Craft 3 at this point, or will you still be adding new features to the 2.x line while 3 is in beta?
At this point we鈥檙e only adding new features to v2 if it will be easy to port to v3. Considering how much has changed under the hood in Craft 3, that means the vast majority of new features are exclusive to v3, but not all.
I know this is quite an old request but i would like to breath some new life into it. There are quite a few occasions where this would really come in handy. For example: I have a product and i want to have variants of that product. Products can only be on level 1 and variant should only go in level 2.
In the meantime, check out the Level Entry Types plugin, which provides this functionality.
Thanks for mentioning that plugin @brandonkelly. Will have a look. Would still be really cool to see this in CraftCMS itself. Thanks for responding either way 馃憤
Most helpful comment
I know this is quite an old request but i would like to breath some new life into it. There are quite a few occasions where this would really come in handy. For example: I have a product and i want to have variants of that product. Products can only be on level 1 and variant should only go in level 2.