We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19726
    • 239 Posts
    Hi, I was working on a site this evening and found something strange. I have a structure like below on my site


    • doc 1
    • doc 2
    • doc 2.1
    • doc 3
    • doc 3.1
    • doc 3.2
    • doc 4

    The only thing is that doc 2.1 is hidden from the menu because the "Show in menu" checkbox in not selected. Now when I navigate to doc2 on the site then the doc2 entry in the tree gets the "activeParentRowTpl" applied which is not what I intendend. I know that technically it is a folder because it has doc2.1 as a child, but since it does not show in the menu I expected doc2 to behave the same as a document with really no children.

    Currently I changed line 157 in the wayfinder.inc.php file. I added an extra check for the number of children to be more than 0 "&& $numChildren>0". This gives me exactly the result I was looking for.

    I don’t know if it is a bug, because after all it is a folder, but it just would not work for me.
      • 7253
      • 97 Posts
      I’m having the same issue as you - I don’t want menu items to be displayed as folders (i.e. appearing to have sub-items) when none of the sub-items are visible (i.e. Show in Menu = false).

      I’ve made your fix to my copy of Wayfinder, but had to make an additional change as I’m using classes rather than tpl’s to determine the styling of menu items. In order to stop the ’parentClass’ class being added to menu items with no visible children, I changed line 172 of wayfinder.inc.php to:

      $classNames = $this->setItemClass('rowcls',$resource['id'],$resource['first'],$resource['last'],$resource['level'],$numChildren,$resource['type']);