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

    In of. site http://www.muddydogpaws.com/development/wayfinder/features.html was written: Wayfinder can add dynamic classes to each menu item.

    I need menu, where each menu item have unique class:
    <ul>
    <li class="nav1"><a href="/music-artists.html" title="Music Artists">Music Artists</a></li>
    <li class="nav2"><a href="/marketing-promo.html" title="Marketing Promo">Marketing Promo</a></li>
    <li class="nav3"><a href="/video-producers.html" title="Video Producers">Video Producers</a></li>
    <li class="nav4"><a href="/bussines-data.html" title="Bussines Data ">Bussines Data </a></li>
    </ul>
    


    What I do:
    [!Wayfinder?&startId=`0`&showSubDocCount=`TRUE`&rowTpl=`topMenuLI`!]
    
    Chunk topMenuLI:
    <li class="nav[+wf.subitemcount+]"><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></li>
    


    What I have:
    <ul>
    <li class="nav0"><a href="/music-artists.html" title="Music Artists">Music Artists</a></li>
    <li class="nav0"><a href="/marketing-promo.html" title="Marketing Promo">Marketing Promo</a></li>
    <li class="nav0"><a href="/video-producers.html" title="Video Producers">Video Producers</a></li>
    <li class="nav0"><a href="/bussines-data.html" title="Bussines Data ">Bussines Data </a></li>
    </ul>
    

    What I do wrong?

    Sorry for my poor English. embarrassed


      • 6726
      • 7,075 Posts
      [+wf.subitemcount+] return the number of documents inside a folder, it’s not meant to be used the way you try.

      Actually, if it’s unique from a CSS standpoint it would make more sense using an ID, and that’s why Wayfinder is not meant to output unique classes wink
      (you could do that though, since TV placeholders are available since Wayfinder 2.0 smiley )

      Which means you should give a look at &rowIdPrefix which appends the document ID to the id.


      Check the doc


      &rowIdPrefix

      default: FALSE
      values: name of prefix
      description: If this parameter is set, Wayfinder will replace the placeholder [+wf.id+] with a unique id consisting of the specified prefix plus the document id.
      example: &rowIdPrefix=`topMenu` will output the following for doc # 29: id="topMenu29"

      http://www.muddydogpaws.com/development/wayfinder/parameters.html

      Hope it helps grin
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l&#39;outil id
        • 23925
        • 11 Posts
        Thank for Your reply.

        Sorry, I forget to say that menu items with nav1, nav2, .... go into (a part of) folder with Id=0.

        This chage something in my question?

        Thank again!
          • 6726
          • 7,075 Posts
          No it does not, [+wf.subitemcount+] return the number of documents inside a folder you can’t use it this way.

          And CSS wise, using unique class doesn’t make much sense as I said... IDs is what you’re looking for if you need unique styling for your menu items... which brings me to the question : what are you trying to achieve, ultimately ?
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l&#39;outil id
            • 23925
            • 11 Posts
            I`m just want to understand how it`s work wink

            Thank for you`r patience.
              • 6726
              • 7,075 Posts
              No problem, that’s what more proficient users are here for, help people who want to learn smiley
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id