We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31290
    • 37 Posts
    I am building a WayFinder menu and I would like to be able to use a placeholder for a Template Variable for the current document.

    For example:
    Document "Home" has a TV called "ExtraText" with a value of "This is the extra text"

    I would like to be able to call this TV from the template like this:

    <a href="[+wf.link+]" alt="[+ExtraText+]">[+wf.linktext+]</a>
    


    Which would result in a link to the "Home" document with an alt tag of "This is the extra text". So it would be pulling the value of the Template Variable from the current document, not from the document that the WayFinder menu is on.

    I have taught myself a lot about templating with WayFinder. I just need pointers to get me headed in the right direction for the TVs as I can’t find anything on this topic. grin

    Thanks in advance!!!
      • 7231
      • 4,205 Posts
      <a href="[+wf.link+]" alt="[+ExtraText+]">[+wf.linktext+]</a>
      This worked for me. As far as I know you can access any TV in the WF chunk. Another option is to use the getField snippet in your Wayfinder tpl chunk, but it is not needed since TVs are available.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 31290
        • 37 Posts
        But using only the Template Variable name will just load the value from the page that is calling the WayFinder snippet, not from the page being inserted into the menu. Basically what I want is to load the a value from the page being inserted, just like it would load the page title or page description.
          • 4749
          • 623 Posts
          If I understand correctly just swap out the + for the * in the placeholder [+variable+] vs. [*variable*]
            The MODx has you...
            Utah Web Design