We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18206
    • 59 Posts
    Sometimes I have problems coming up with legible subject lines.. can you tell? tongue

    Anyhow, my problem seems a simple one. I have a vertical main menu that collects the first level of my site as such:
    [!Wayfinder &startId=`0` &level=`1` ... !]

    I want the currently active page to appear in the menu as non-clickable text. I have solved this by using a &hereTpl, so far so good! The problem is that I am using a second wayfinder call to generate a side menu with child pages, using this WF-call:
    [!Wayfinder &startId=`[[UltimateParent]] ... !]` (there is only one sub level.)

    A horizontal list is generated from the data, and everything works fine until I click one of these links. What happens then is that while the page displays correctly, the parent text in the main menu is now a clickable link which messes up the CSS-formatting. I figured that this is because &hereTpl now is associated with the child document. I’m trying to get around this using &activeParentRowTpl or &parentRowHereTpl in the main menu WF call, but since that list is only one level they aren’t used. The menu seems to fall back to using &rowTpl for the active parent page despite my efforts.


    update: I took a look at the core code and made a small change that may or may not be solid: as &parentRowHereTpl depends on having children in the dataset, I decided to tweak away at &activeParentRowTpl. The only change that had to be made was on row 157 of wayfinder.inc.php:
            } elseif ($resource['isfolder'] && $this->_templates['activeParentRowTpl'] && ($resource['level'] < $this->_config['level'] || $this->_config['level'] == 0) && $this->isHere($resource['id'])) {

    was changed to
            } elseif ($resource['isfolder'] && $this->_templates['activeParentRowTpl'] && ($resource['level'] <= $this->_config['level'] || $this->_config['level'] == 0) && $this->isHere($resource['id'])) {

    Note the less-or-equal check. This makes it so that basically any folder in an active path uses &activeParentRowTpl, even if no children are displayed. This may lead to unforeseen consequences of detrimental nature, I’m really not sure as I lack experience. Maybe someone with more knowledge could say if this fix is reasonable.


    edit: Actually, my change has made that section of the if-clause unambiguous; it can simply be removed:
            } elseif ($resource['isfolder'] && $this->_templates['activeParentRowTpl'] && $this->isHere($resource['id'])) {


    Still, possible damage?