We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39029
    • 5 Posts
    Hi everybody,
    I'm relatively new to modx, but I'm used to work in some other CMS' and to do PHP programming.

    A weird thing is going on here: Wayfinder works, but does not react to any of my parameters such as startId, level, or anything else. And I can't find a reason why. I'm using MODX Revolution 2.2.6-pl (traditional). On a different project on an different server, everything works as it should and I can control the Wayfinder output. The only differences I can tell of is, that it's on MODX Revolution 2.2.0-pl2 (traditional) and that I'm having a <div> in my chunk instead of just the pure Wayfinder call. So as soon as I'm adding some HTML-Code around my Wayfinder call like here
    <div id="globnav">
    <nav>[[Wayfinder? &startId=`2` &level=`1`]]</nav>
    </div>

    instead of just having
    [[Wayfinder? &startId=`2` &level=`1`]]

    everything works just fine.

    Any ideas, why that?
    Thanks in advance.
      • 37042
      • 384 Posts
      Hi rocketom.
      Does your working Wayfinder call have a parameter called rowClass or something similar?

      Here's an example of one of my working calls

      [!Wayfinder? startId=`0` &level=`1` &rowClass=`topnav` &includeDocs=`1,2,12,81,95,99`]
        ...
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Are you sure that resource ID #2 is published and has published children set to show in the 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
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          Try it without the div.

          <nav id="globnav">
          [[Wayfinder? &startId=`2` &level=`1`]]</nav>
          


          You may want to make &outerTpl and &rowTpl chunks so that Wayfinder doesn't use the defaults, but rather the classes/ID's you tell it to use. Place markup & classes/id's within the tpl chunks. add them to the Wayfinder call.

          &outerTpl

          Name of the chunk containing the template for the outer most container; if not included, a string including "<ul>[[+wf.wrapper]]</ul>" is assumed

          Available placeholders are:

          wf.classes - outputs relevant classes (including class=" ")
          wf.classnames - outputs relevant classes (without class=" ")
          wf.wrapper - outputs inner (row) contents. This placeholder is required.

          Please note that you will need to wrap the placeholders with the relevant tags.
          Evolution: [+wf._____+]
          Revolution: [[+wf._____]]

          Example of an &outerTpl chunk (Evo):
          1<ul id="topnav"[+wf.classes+]>[+wf.wrapper+]</ul>

          Revo:
          1<ul id="topnav"[[+wf.classes]]>[[+wf.wrapper]]</ul>

          The following table shows other parameters to change your output, that use the same placeholders as the &outerTpl parameter.
          Parameter Description
          &innerTpl Name of the chunk containing the template for any subfolders listed in the menu.

          &rowTpl Name of the chunk containing the template for the regular row items.

          Available placeholders are:

          wf.classes - outputs relevant classes (including class=" ")
          wf.classnames - outputs relevant classes (without class=" ")
          wf.link - the href value for your link
          wf.title - the title text for the link, from the field as specified in the &titleOfLinks parameter
          wf.linktext - the text for the actual link, from the field as specified in the &textOfLinks parameter
          wf.wrapper - outputs inner contents such as submenus
          wf.id - outputs a unique ID attribute. You will need to specify the &rowIdPrefix parameter in order for this placeholder to receive a value. The value is your prefix + the docId.
          wf.attributes - outputs the link attributes of the current item
          wf.docid - the document identifier for the current item
          wf.description - the current item's description

          Default is:
          &outerTpl
          <ul[[+wf.classes]]>[[+wf.wrapper]]</ul>

          &rowTpl
          <li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

          &startItemTpl
          <h2[[+wf.id]][[+wf.classes]]>[[+wf.linktext]]</h2>[[+wf.wrapper]]

          Also, just for kicks and giggles, try setting the &level to a higher number. I'm still not 100% clear on how that works for child containers of level 1 resources.
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 39029
            • 5 Posts
            Quote from: frogabog at Jan 08, 2013, 01:50 PM
            Try it without the div.

            <nav id="globnav">
            [[Wayfinder? &startId=`2` &level=`1`]]</nav>
            

            I'll try that, Frogabog. But I'm shure you agree with me: This shouldn't make a difference in wether it does work as stated in all docs or not.

            You may want to make &outerTpl and &rowTpl chunks so that Wayfinder doesn't use the defaults, but rather the classes/ID's you tell it to use. Place markup & classes/id's within the tpl chunks. add them to the Wayfinder call.
            That's exactly what I intend to do once this thing is sorted out.

            &outerTpl
            Name of the chunk containing....
            Thanks mate. I came across this already though.


            Also, just for kicks and giggles, try setting the &level to a higher number. I'm still not 100% clear on how that works for child containers of level 1 resources.
            Well, it doesn't matter. It either does work obeying to all paramaters or to none of them at all.
              • 39029
              • 5 Posts
              Quote from: sottwell at Jan 08, 2013, 11:41 AM
              Are you sure that resource ID #2 is published and has published children set to show in the menu?
              Thanks, sottwell, for contributing.
              This is all tested not to be the cause of this symptom. I can make it work or not just by changing between having a single line of a pure Wayfinder call or with a div around it as quoted. All this wile leaving resource status untouched. Puzzling to me.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Indeed. Unless there's something in the CSS hiding it?
                  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
                  • 39029
                  • 5 Posts
                  Quote from: sottwell at Jan 08, 2013, 03:23 PM
                  Indeed. Unless there's something in the CSS hiding it?
                  True. But not the case. Before I had the wrapping div in the page template.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    But I can have a resource with a template with absolutely nothing in it except the chunk tags, and the chunk has nothing except a Wayfinder snippet, and it works just fine, generating the unordered list as expected. Something is very strange here.
                      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
                      • 10208 ☆ A M B ☆
                      • 1,780 Posts
                      You're not in a rte are you?
                      What's the source say when it doesn't render?
                        Frogabog- MODX Websites in Portland Oregon
                        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                        Having server issues? These guys have MODX Hosting perfected - SkyToaster