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

    I'm trying to have wayfinder output a menu, and the submenus (dropdown via css) have this format:
    <img><a href="wayfinder stuff"></a><p>Description of article</p>


    Here's what I've done so far take a look at it and tell me where I'm going wrong.

    Wayfinder Call:

    [[Wayfinder? &startId=`0` &level=`2` &firstClass=`` &innerClass=`` &lastClass=`` &innerRowTpl=`submenuRows`]]


    And my innerRowTpl named submenuRows:

    <li[[+wf.classes]]>[[*NavIcon]]<a href="[[+wf.link]]" title="[[+wf.title]]">[[+wf.linktext]]</a>[[*NavDescription]][[+wf.wrapper]]</li>


    NavIcon and NavDescription are both TV's. Each page will have a 30x30 image and a brief description, which I want wayfinder to include in each submenu. Can someone point me in the right direction? I'm pretty new to wayfinder, and have been banging my head against this one. I've read a few previous posts and come up empty. Any help would be appreciated!

    Greg
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      [[+template_variable_name]]


      If you use the regular TV tag syntax, it will be the value for the page you're looking at; MODx will apply it for the current page. The placeholder syntax is what Wayfinder uses in its own tpl to apply to each resource it processes.
        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
        • 39159
        • 23 Posts
        Hi,

        OK I've got it - makes sense it was late last night so that definitely didn't occur to me. Wayfinder will simply take the resource from the current page and put it into my nav menu which is not what I want. I want wayfinder to not only get the link title from each document in the menu, but also get two TV's - icon and description, and render them in the output.

        Is there anyway to do this? or am I simply going to be chasing my tail the entire time?

        Greg
          • 36404
          • 307 Posts
          Hi,

          won't be able to help a lot in revo but just to say i did this quite easily in evo using a snippet in the chunk, transcribe it into "revo language" and do not pay attention to the yams part but it looks like this
          $rowTpl = '@CODE:
          	<li[+wf.classes+]>
          	<a href="(yams_docr:[+wf.docid+])"[+wf.classes+]>[[getMenuTvValue? &tv=`menu_vign` &docid=`[+wf.docid+]`]] [[YAMS? &get=`data` &from=`menutitle` &docid=`[+wf.docid+]`]]</a>
          	[+wf.wrapper+]
          	</li>';

          the trick is the getMenuTvValue which retrieves the image tv value and outputs it in a span
          if you want to retreive more than one tv just send the docid to the snippet and have it get and output exactly what you want
          actually, this way you can build pretty complicated menus, wayfinder being just here to put things in the imbricated ul li with its useful classes

          have swing
            réfléchir avant d'agir
            • 39159
            • 23 Posts
            Hi,

            I finally figured it out and got it working.... no need for snippets. I posted for someone else just in case they stumble here.

            https://forums.modx.com/thread/76095/wayfinder-submenu-image-description---including-tv-in-

            In Revo this works - I can confirm that.

            Greg