We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47562
    • 113 Posts
    Wayfinder help needed!

    Thought I had this nailed down, but some docs refuse to show up.

    I'm trying to include all leaf resources under container resource 2 (in addition to container resource 18). All pages in question are published and not hidden from menus.

    I've tried with isfolder 0, with including settings for limit, context, etc etc, but still no joy. Looking at the values in the debug dump, I don't see an issue.

    The call (within a chunk that's used in a template) is:
    [[Wayfinder? &startId=`2` &where=`{"isfolder:=":"false","OR:id:=":18}` &rowTpl=`nav_bottom_subitem_tpl` &innerTpl=`nav_bottom_subinner_tpl`]]


    The subinner tpl is just:
    [[+wf.wrapper]]


    The subitem tpl is:
    <li [[+wf.classes]]>
    	<a href="[[+wf.link]]" title="[[+wf.title]]">[[+wf.linktext]]</a>
    	[[+wf.wrapper]]
    </li>


    Can anyone tell me where I'm going wrong? [ed. note: smashingred last edited this post 12 years, 2 months ago.]
      • 27708 MODX Staff
      • 2,502 Posts
      For clarity I am going to reformat your Wayfinder call:
      [[Wayfinder? 
        &startId=`2` 
        &where=`{"isfolder:=":"false","OR:id:=":18}` 
        &rowTpl=`nav_bottom_subitem_tpl` 
        &innerTpl=`nav_bottom_subinner_tpl`
      ]]
      


      I've never done this before but it appears that in the docs the where clause uses square brackets wrapped around the JSON. I have no idea if this makes any difference.
      [[Wayfinder? 
        &startId=`2` 
        &where=`[{"isfolder:=":"false","OR:id:=":18}]` 
        &rowTpl=`nav_bottom_subitem_tpl` 
        &innerTpl=`nav_bottom_subinner_tpl`
      ]]
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 47562
        • 113 Posts
        Thanks for the suggestion, Jay.

        I put in the square brackets (believing that it never hurts to follow the directions as given in the docs), but unfortunately, no difference in results this time. I have a nagging suspicion that I'm missing something basic here...
          • 47562
          • 113 Posts
          After thinking about this, I decided to go with getResources instead; it has the very handy "hideContainers" parameter, and generates exactly what I'm looking for via the call:

          [[!getResources?
              &parents=`[[+wf.docid]]`
              &tpl=`nav_bottom_item_tpl`
              &hideContainers=`1`
              &sortdir=`ASC`
              &includeTVs=`1`
              &processTVs=`1`
              &depth=`10`
              &sortby=`menuindex`
          ]]


          Cheers!