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

    I'm trying to do a Wayfinder call, where I hide certain parents/containers but not their child documents. While using the &excludeDocs or &where parameters, the children won't show up (of course). Also using the "hide from menu" option in the document settings causes a similar behavior.

    Any ideas? Help, please! smiley
      L.net Web Solutions
      Professional webdesign and development with MODX and WordPress.
    • You could use a "category" tpl to put a specific classname to such items, where a "category" is defined as a resource with no template or a resource with an attribute setting of rel="category", then have some javascript or CSS to style it and the rest of the menu.

      &categoryFoldersTpl default: NULL
      values: name of template chunk
      description: The categoryFoldersTpl is used when the item is a folder, and either has the template set to blank or has rel="category" in the link attributes field. The children of the item must be displayed for this template to be used as well. 
      available placeholders: Same as RowTpl. 
      example:
      <li[+wf.classes+]> <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a> [+wf.wrapper+]
      </li>


        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
        • 36926
        • 701 Posts
        Are you using revo or evo.

        If revo how about setting your own TV to define if parent should be displayed or not and then using some input/output filters on the &parentRowTpl.

        So for example &parentRowTpl would be

        [[+hideParent:notequalto =`1`
        :then=`<li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>`
        :else=`[[+wf.wrapper]]`]]
        


        Note i've split the call over 3 lines only so it's easier to read. For your actual call you'll prob want to avoid the line breaks.

        hideParent would be your TV say a check box that has a value of '1'. If checked just the wf.wrapper will be displayed which will mean no info about the parent is visible.

        You may also need to set the innerTpl with code that doesn't contain the output filter as not sure if the child docs will inherit &parentRowTpl template.

        I haven't actually tried this but would of thought it would work.

        The other alternative is possibly seeing if you can achieve it using getResources.
          • 21078
          • 77 Posts
          Ok, thank you for your answers! I did a quick-and-dirty solution with hiding certain parents via jQuery. It would have been nicer to set a parameter in the Wayfinder call to achieve this, but it works for now ... wink
            L.net Web Solutions
            Professional webdesign and development with MODX and WordPress.