We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    I’m working on porting over an existing site to MODx. I’ve read through the Wayfinder docs, so I have a menu generating, but my original style sheet used
    class=’selected’
    to denote the active tab. I also have specific style class for the unordered list that’s used for tab generation. I’ve been looking through the docs and some of the code for most of the day and I haven’t come across anything that explains what values get used for [+wf.classes+].

    The easy option here is to simply change my style sheet so it utilizes the class of ’active’, but I thought it would be illuminating if I could understand those mysterious [+ placeholders. And if I create a separate chunk for the ul style of my menus (e.g. modifying the mh.InnerTpl), how would I tell Wayfinder to use the one and not the other?

    I’ve been adding a list of them to the wiki, if anyone is interested:
    http://wiki.modxcms.com/index.php/Placeholders_used_by_MODx_Pages_and_Templates
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      Ok, I answered one of my questions:
      Passing a value to Wayfinder can change what class is used when an item is selected:

      &hereClass=`name_of_my_CSS_class_for_the_selected_tab`

      Using &selfClass added the class name to active, which isn’t quite what I wanted:
      li class="active name_of_my_CSS_class_for_the_selected_tab"

      I thought I could edit the chunks for setting what the class of the ul tag should be, but I haven’t cracked that nut yet.
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Sweet, I just figured out the other half of this. It seems obvious looking back, but I didn’t catch it when I was setting it up.

        You make your own chunk and give it a name. E.g. I made a chunk called yui.OuterTpl that contained this:
          <ul class="yui-nav">
            [+wf.wrapper+]
          </ul>


        And then when I called Wayfinder in my template, I just referenced the name of that chunk in the outerTpl variable. So here’s what my call to the Wayfinder snippet looks like:

        [!Wayfinder?startId=`0` &level=`1` &hereClass=`selected`  &outerTpl=`yui.OuterTpl` !]


        I’m off to update the wiki...