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

    I’m trying to get wayfinder to work.
    I installed and set up modx revo, and set a basic test site up.
    I’ve created templates and resources, and set up friendly urls.

    Now I want to create a basic flat navigation menu.

    I used package management to download and install wayfinder, and cleared the cache.

    My test template includes this bit of code:


    <div id="nav">
    
    [[!Wayfinder? &startId=`1`!]]
    
    </div> <!-- nav ends -->
    



    I then assign that template to a resource.
    When I then preview the resource, I can’t see a menu.
    That portion of the html source for the page is blank.

    What could I be doing wrong?

    Thanks.
      • 1778
      • 659 Posts
      Hello

      If you want your Wayfinder menu starts with the resource ID 1 (your home page I suppose) you have to call Wayfinder with a &startId=`0` where "0" is the root, (and the root is not a "resource" and has no ID so it’s 0). You can also precise the depth of your menu by setting the &level parameter

      // Displays a menu with all resources under the root
      [[!Wayfinder? &startId=`0` ]]
      
      //Displays the 1st, 2nd and 3rd level from the startID (here the root)
      [[!Wayfinder? &startId=`0` &level=`3` ]]
      
      //displays 2 level depth under the resource with ID 45 (so you don't see the resource ID45 in the menu)
      [[!Wayfinder? &startId=`45` &level=`2` ]]
      


      Hope this helps
      Cheers
      • The &startId parameter indicates the parent you want to start with; in other words Wayfinder will use the children of the resource whose ID you specify for generating its menu.
          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
          • 25315
          • 68 Posts
          Thanks.

          changing the startId property got it working.

            • 4750
            • 28 Posts
            I cannot get the wayfinder to work!

            This is what I have,

            [[!Wayfinder?&startId=`0`&level=`1 &outerTpl=`mmenuouter`]]

            But nothing shows there is nothing in the outputted code, is there something I am doing wrong?

            cbartgu,
              • 1778
              • 659 Posts
              It seems you ommit the ending backtick in &level=`1` your call is [[!Wayfinder?&startId=`0`&level=`1backtick is missing here &outerTpl=`mmenuouter`]]
              Cheers
                • 4750
                • 28 Posts
                Yes, well spoted I changed it, but it still is not showing any of the menus, I had the wayfinder sussed in the old modx but now it seems to have changed, this is my code that does not work,

                [[!Wayfinder?&startId=`0`&level=`1`&outerTpl=`mmenuouter`]]

                Any more suggestions,

                cbartgu,
                • Try to use the &debug=`1` option, it will output a table with informations of what he has found.
                  If not, reinstall wayfinder or check if you’ve entered the right reference into &startId.

                  Even if you have not set the options properly, if debug setting is on true, it should output the debug table if wayfinder is working properly.
                    • 4750
                    • 28 Posts
                    [[!Wayfinder?&startId=`0` &level=`1` &outerTpl=`mmenuouter` &debug=`1`]]

                    The debug is not showing, is there anything else I need to do to see it?
                    • Try to reinstall wayfinder first, and leave outerTpl empty to see if it outpu the default chunk menu.