We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Hi Guys,

    Trying to get my head around wayfinder.

    This code

    [[Wayfinder? &startId=`1` &level=`0`]]


    shows the child links under id 1 but how do you display the parent title in position 1 as well please?

    I just need the wayfinder syntax and not the css parameters.

    Also is there a way of generating the menu dynamically from the navigation tree eg

    if my resource tree is

    Section 1
    >section1a
    >section1b
    >section1c

    Section 2
    >section2a
    >section2b
    >section2c

    ...

    I would love to be able to generate the menu (I’m using superfish menu) so I can dynamically generate the parent and children links like:

    | Section 1 | Section 2 | ............<--horizontal nav-->
    section1a section2a
    section1b section2b
    section1c section2c

    I assume I will need some looping syntax like that for getresources?

    Thanks a million..just starting out with modx and wayfinder.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The second part first. That will be done with your css; Wayfinder will generate a nested unordered list that Suckerfish or any other CSS/Javascript drop-down or flyout menu can work with.

      As far as showing the parent, use &displayStart=`1`. By default it will put the parent’s menutitle in an h2 element. Using outerTpl, rowTpl and startItemTpl cleverly you can actually have it as an integral part of the menu structure if that’s what you want.

      I’m attaching my favorite Wayfinder cheat-sheet. Of course you should go get the Wayfinder ebook. http://modxcms.com/forums/index.php/topic,34176.0.html

      Just keep in mind that the placeholder and snippet tags are different for Revo.
        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
        • 12410
        • 353 Posts
        Thanks
        This http://codingpad.maryspad.com/2011/02/21/modx-revolution-for-complete-beginners-part-8-using-wayfinder-to-create-menus/ (opens best in google chrome)

        got me over the finish line if it helps anyone else. The eBook is great work! Well done to the author!
          • 12410
          • 353 Posts
          Hi,

          I used

          [[!Wayfinder?
            &startId=`0`
            &outerTpl=`horizNavmenuOuter`
            &rowTpl=`horizNavmenuRow`
            &innerTpl=`horizNavmenuInner`
            &innerRowTpl=`horizNavmenuInnerRow`
            &hereClass=`current_page_item`
            &firstClass=``
            &lastClass =`` ]]


          to display all the menu items in the resource tree which is fine but how do you adjust the parameter syntax for the destination page so it just displays that page’s parent title and child titles. (I’m building a separate vertical menu). Using the above menu structure when I navigate to say Section 2 I just want:

          Section 2
          >section 2a
          >section 2b
          section 2c
          ....dynamically generated in the menu (as opposed to setting hard coded start id’s)

          I tried &startId=`[!UltimateParent!]` but no joy.
          Any ideas please?
            • 12410
            • 353 Posts
            Cool i didnt realise i had to download the ultimate parent package. Thought it was a modx/wayfinder parameter. yay!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Don’t forget that you need to use Revo snippet tags for the UltimateParent snippet call.
              [[!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
                • 12410
                • 353 Posts
                Thanks I saw this elsewhere:

                &startId=`[[UltimateParent? &topLevel=`0`]]`


                Does that syntax look ok for Modx Rev 2.0.8?

                Cheers
                  • 33968
                  • 863 Posts
                  I don’t think you need to use UltimateParent here.

                  Just add &displayStart=`1` to your Wayfinder call and it will show your start page in the menu too.