The Wayfinder docs are somewhat ambiguous on this.
Do the parent tpls affect any menu item that is a folder or only folders that have children?
I’m guessing the latter. Either way, this should be clarified in the docs.
From the Wiki:
&parentRowTpl
the template chunk for any document that is a folder
&parentClass - (parent)
CSS class denoting the menu item is a folder (has children)
-
MODX Staff
- 12,272 Posts
Should really be "container" which is based on the flag in the manager, but containers don’t necessarily have to have children. No idea if it functions that way.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
According to my test parentRowTpl is only called if there are children, regardless of if the document is a container or not.
Did not test the parentClass yet. Just tested it and it is the same as above, the class only is displayed if there are children regardles of being a container.
Wayfinder does not rely on the container flag, it actually checks for children and basses the parent status on this.
Quote from: dev_cw at Aug 06, 2008, 08:21 AM
According to my test parentRowTpl is only called if there are children, regardless of if the document is a container or not.
Did not test the parentClass yet. Just tested it and it is the same as above, the class only is displayed if there are children regardles of being a container.
Wayfinder does not rely on the container flag, it actually checks for children and bases the parent status on this.
Thanks! I edited the Wiki. There are probably other place this should be changed as well.
Can a document have children without being a container? If so, I would think that should be considered a bug.
-
☆ A M B ☆
- 24,524 Posts
Only under certain conditions, such as a badly written snippet or module or plugin. A document can be assigned another document as parent, but the parent document’s record in the database is not updated to have its "isfolder" field set to 1. Or if there is some kind of database corruption. When this happens, the "child" document will never be seen in the document tree.
Quote from: sottwell at Aug 06, 2008, 11:47 AM
Only under certain conditions, such as a badly written snippet or module or plugin. A document can be assigned another document as parent, but the parent document’s record in the database is not updated to have its "isfolder" field set to 1. Or if there is some kind of database corruption. When this happens, the "child" document will never be seen in the document tree.
I can see how that could happen. I’m guessing that the core code would never create such a condition on its own and that you can’t do it in the Manager.