I'm using Wayfinder to build my site menus and I'm having a bit of an issue: the parent class is being applied to the <li> tags for resources which are containers but who have all their children hidden from menus. This is confusing to the user since on this particular site parent items are rendered differently than leaf items and they see a "parent" which doesn't display children.
The documentation states that the parentClass parameter is set as the "CSS class for menu items that are a container and have children". The behavior, as I read it, is as documented, but I still think it is counter-intuitive and a bug. I can't really imagine a use case where I would want the parent class applied to a container whose children are all hidden, although having this functionality available wouldn't offend me, I just think it would be better to default to not using the parent class in this case.
I just discovered I can work around this by unchecking "container" on the parent resource. Hopefully a "non-container" with children doesn't turn out to cause unforseen consequences in other respects. Does anyone know of any other way to get this resource to not use the parent class?
-
☆ A M B ☆
- 24,524 Posts
You can use a "category" tpl instead, and use a link attribute. This applies to top-level items that have visible children.
&categoryFoldersTpl default: NULL
values: name of template chunk
description: The categoryFoldersTpl is used when the item
is a folder, and either has the template set to blank or has
rel="category" in the link attributes field.
The children of the item must be displayed for this template
to be used as well.
available placeholders: Same as RowTpl.
[ed. note: sottwell last edited this post 14 years, 2 months ago.]