We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29641
    • 13 Posts
    Hi,
    in my old "cms" - AWF 1.0 smiley - Im often using resource hierarchy as navigation column (sidebar). Now I started to use Revo and missed this feature. After some research I found solution by a little addition in Wayfinder's wayfinder.class.php
    Maybe it can help others too, so here is the code
    - added new item to $this->_config:
    'navigation' => false,

    - in function run() added after
    $this->parentTree[] = $this->_config['hereId'];

    the following
    if ( $this->_config['level'] < 0 ) {
       $this->_config['level'] = (count($this->parentTree) -1) - $this->_config['level'];
       $this->_config['navigation'] = true;
    }

    - in function buildMenu() added
    if ( $this->_config['navigation'] && !$this->isHere($parentId) )
       continue;

    before
    if ( (!$this->_config['hideSubMenus'] || $this->isHere($parentId) || $parentId == 0) )


    Thats the all. Now you can use negative value in "level" parameter, resulting a navigation tree from root to actual document + abs "level" (practically level=-1).
    Perhaps not the most elegant solution, but pardon me, im n00b a bit smiley My english weak also sad
    • I'm not sure exactly what you are trying to accomplish. You should not need to modify Wayfinder to build up any kind of menu structure you want. I think that what you are describing is usually accomplished by using the UltimateParent snippet to provide the startId property's value.

      http://modx.com/extras/package/ultimateparent
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 29641
        • 13 Posts
        Perhaps its my primitive english sad
        I would like to walk on the tree without open all subtrees.
        Hope the attached pics explains it a bit better:
        • There are several ways to do that. You can use the &level property to say how many levels you want to show. Or you can use the &hideSubMenus property to only show the top level, and the submenu of the active page.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 29641
            • 13 Posts
            Told I "I'm n00b" before ? &hideSubMenus did the trick smiley
            Thank you for your attention, Susan !