We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7230
    • 1 Posts
    Hi guys,
    I am trying to create a navigation using the Navigation Matrix Method.

    How do I go about assigning unique ID to the generated <li> (maybe the menu name?). I am still learning ModX, and I would really appreciate it if someone could point me to the right direction.
      • 7231
      • 4,205 Posts
      How do I go about assigning unique ID to the generated <li> (maybe the menu name?).
      There are a few ways to do this. If you want the menu title you can simply add this to the rowTpl (or other appropriate tpl chunk) like this:

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


      Then in the Wayfinder call add rowTpl=`nameOfTplChunk` to assign the code in the chunk to the specific template tpl.

      In the same fashion you could use any Template or Document Variable.

      You could also use the same the linktext output. Just set the &textOfLinks to menutitle
      <li id="[+wf.linktext+]">
      	<a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
      	[+wf.wrapper+]
      </li>
        [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]