I’ve been wondering this for a while, since there doesn’t seem to be any functional difference between a standard resource with children, and a resource with Container checked on Page Settings. Am I missing something?
Thanks,
adam
I think Wayfinder etc. make use of it even if works without checking it.
-
☆ A M B ☆
- 24,524 Posts
This is mainly for use in the Document Tree. If you clear the checkbox for a document that has children, the children will no longer be visible in the Document Tree! It’s also useful in menu or listing snippets to assist in generating nested lists.
Since the setting will be automatically updated in the database when a child is assigned a parent, the checkbox really isn’t necessary; although it’s useful for "demoting" a document in the Tree when all of its children have been moved or deleted.
-
MODX Staff
- 12,272 Posts
I am currently working on cleaning up the Evo branch and actually debated removing this flag. Yes, it offers a degree of flexibility, but no more so than what can be done with the link attributes. To me, I see it causing more problems and confusion than for the super-corner-case where it’s actually useful and serves a real purpose (beyond demoing, which can likewise be demod by creating a doc).
Thoughts on getting more clutter out of the Manager page by nuking this field?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts
The only downside that I see is that now there won’t be a way to get rid of the setting if all children are moved or deleted. I suppose it could be done in code; every time a document is moved or deleted check the old parent and see if it’s got any more children, clear the setting if it doesn’t.
-
☆ A M B ☆
- 24,524 Posts
Coincidentally I was looking at the code for the move_document processor, and it does have code for setting that field to 0 if there are no more children. I haven’t looked at the delete code yet. But I do know that occasionally I end up with "folders" that just say "this folder is empty"; never paid much attention to exactly how that came about.
Me too and have had to uncheck the container flasg manually to get rid of the + in the tree
especially happens if you delete child pages as it doesn’t seem to reset the flag if there are no child pages
and also if you have jot comments and delete them.
Slight annoyance, but easy to put up with if getting rid of it throws up other issues!
Mark