We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    No. The full ID will be like this:

    id="<whatever-you-put>xx"
    where xx is the resource ID for the link item. So if you put "&rowIdPrefix=`list`" then you'll get list1, list2, list3, etc for every menu item, but it will only get used where you have [[+wf.id]] placeholders. So create a chunk tpl for the outerRowTpl something like this:
    <li [[+wf.classes]] [[+wf.id]]><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>

    The other rowTpl and innerRowTpl would not have the placeholder.

    Then in your CSS you can style li#list1, as well as all of it children: li#list1 ul li, etc.
      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
      • 10576
      • 13 Posts
      Okay, I added this to my call:

      [!Wayfinder?startId=`2` &hideSubMenus='true' &outerRowTpl=`li_classes` &rowIdPrefix=`list`!]

      This is my outerRowTpl
      <li [[+wf.classes]] [[+wf.id]]><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>

      But I see that the output is this:

      <ul>
      <li id="list6" class="active"><a href="/percheron/index.php?id=6" title="Percheron Energy" >Percheron Energy</a>
      <ul>
      <li id="list7"><a href="/percheron/index.php?id=7" title="Technology" >Technology</a></li>
      <li id="list8" class="last"><a href="/percheron/index.php?id=8" title="Leadership" >Leadership</a</li>
      </ul>
      </li>
      <li id="list10"><a href="/percheron/index.php?id=10" title="Field Services" >Field Services</a></li>
      <li id="list14" class="last"><a href="/percheron/index.php?id=14" title="Survey" >Survey</a></li>
      </ul>

      I'm looking for a way to have each row have it's own class, but have their children also have the same class

      <ul>
      <li class="list1">Example
      <ul>
      <li class="list1">Example</li>
      <li class="list1">Example</li>
      </ul>
      </li>
      <li class="list2">Example</li>
      <li class="list3">Example</li>
      </ul>

      G

        • 22427
        • 793 Posts
        sottwell said it already in her very first reply: You can achieve this using adequate definitions in your CSS:
        ul li.list1, 
        ul li.list1 ul li {
            /* here the rules for your class list1 */
        }
        
        ul li.list2, 
        ul li.list2 ul li {
            /* here the rules for your class list2 */
        }
        
        and so on.
          • 10576
          • 13 Posts
          Okay, so I need to not worry about what wayfinder does, and just use CSS? I still can't get my rows to have list1, list2 and list3 for my classes. Am I missing something? when I do level, it does, but not when there are children because it makes the first rows all 1, and the children level2. I guess I don't know what I'm doing, and I apologize.

          g
            • 22427
            • 793 Posts
            The Wayfinder call you gave in your reply #12 uses Evo syntax:
            [!Wayfinder?startId=`2` &hideSubMenus='true' &outerRowTpl=`li_classes` &rowIdPrefix=`list`!]
            That should be
            [[!Wayfinder?startId=`2` &hideSubMenus='true' &outerRowTpl=`li_classes` &rowIdPrefix=`list`]]
            (if it's not just a typo here.)
              • 10576
              • 13 Posts
              I am using evolution. Should I not be?

              nevermind, I see what you mean. I cut and pasted that code from a previous post here to see if it would fix my problem.
                • 22427
                • 793 Posts
                Sorry, my fault: Of course it's the ID which is prefixed. So we dont need class rules but rules for the IDs.
                So the CSS should be this (as was already mentioned by sottwell):
                ul li#list1,
                ul li#list1 ul li {
                    /* here the rules for your list1 items */
                }
                 
                ul li#list2,
                ul li#list2 ul li {
                    /* here the rules for your list2 items */
                }
                  • 22427
                  • 793 Posts
                  I am using evolution.
                  Then your template chunks also need Evo syntax:
                  Instead of
                  <li [[+wf.classes]] [[+wf.id]]><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>
                  it should read
                  <li [+wf.classes+] [+wf.id+]]><a href="[+wf.link+]">[+wf.linktext+]]</a></li>
                    • 22427
                    • 793 Posts
                    BTW: Isn't there the [[+wf.wrapper]] (or [+wf.wrapper+] in Evo) placeholder missing in your &outerRowTpl?
                      • 10576
                      • 13 Posts
                      Okay, I currently have a div around my leftnav as so:

                      <div id="leftnav">


                      <ul>
                      <li class="list1 active"><a href="#">Percheron Energy</a>
                      <ul>
                      <li class="list1 active"><a href="#">Technology</a></li>
                      <li class="list1"><a href="#">Leadership Bios</a></li>
                      <li class="list1"><a href="#">Process</a></li>
                      </ul>
                      </li>
                      <li class="list2"><a href="#">Field Services</a>
                      <ul>
                      <li class="list2"><a href="#">Technology</a></li>
                      <li class="list2"><a href="#">Leadership Bios</a></li>
                      <li class="list2"><a href="#">Process</a></li>
                      </ul>
                      <li class="list3"><a href="#">Survey</a>
                      <ul>
                      <li class="list3"><a href="#">Technology</a></li>
                      <li class="list3"><a href="#">Environmental Page</a></li>
                      <li class="list3"><a href="#">Leadership Bios</a></li>
                      <li class="list3"><a href="#">Process</a></li>
                      </ul>
                      </li>
                      </ul>


                      </div>

                      So what your saying is by using a &rowIdPrefix to get ID's added to my li's, then I just need to add a style to say:

                      ul li#list6,
                      ul li#list6 ul li {
                      /* here the rules for your list1 items */
                      }

                      ul li#list10,
                      ul li#list10 ul li {
                      /* here the rules for your list2 items */
                      }


                      But it looks like my children also have an id in the li as well. will the stylesheets override what wayfinder has put in the code?