We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30564
    • 60 Posts
    Having searched with out success, though I do seem to have bad search karma here sad a query. I’d like to be able to change the style for a menu option by type, i.e. Blue for menu defaults, but say red for the link to Forum, green to link for Blog. Ideally like to use the sliding doors technique & wayfinder.

    Thoughts ... suggestions.. you missed x in the config options {hopefully} smiley

    Regards
      • 30564
      • 60 Posts
      79 views and no responses. Do I take this as a"no’ then?

      Regards
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It is possible to give each row unique IDs in Wayfinder.

        &rowIdPrefix - For each document that Wayfinder lists, the value you set in this parameter will be prepended to the document ID then placed in the [+wf.id+] placeholder. This placeholder can then be used in any row-level template.
        You could have the default style as usual, then specific styles for the items you want to be different.

        There is an excellent document for Wayfinder you can download from the Wayfinder 2 wiki page. I keep it handy, and use it for just about every site I build. (well, I do have a memory like a sieve, so I need it for a "cheat sheet").
          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
          • 30564
          • 60 Posts
          ^ Thanks for this, but reviewing it appears to be still row based, rather than a specific item within the row.

          The idea would be to create html in principal similar to
          <ul>
          <li class="level0">Home</li>
          <li class="level0Red">Forum</li>
          <li class="level0">Review</li>
          <li class="level0Blue">Review</li>
          ... .....
          </ul>
          there by using the CSS for elements level0 to create the standard , say grey tab, format, level0Red creating, a red tab, and as may be expected level0Blue a blue one.

          Regards
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Row in Wayfinder means each item. It may be <li>... </li>, or it could be whatever other elements you use in your templates.

            What you would get would be
            <li id="item1">....
            <li id="item2">...
            etc

            if you specify $rowIdPrefix=`item`, and in your template had [+wf.id+], each row (a row being each link) would get an ID of "item" + its document ID. So if your Forum page is #7, its link would have an ID of item7. Then in your css, you would simply have #item7 styled with red.

            If you only need this in the first level of the menu, you could use a template for "parents", and just have the [+wf.id+] placeholder in that template. Then only the top-level items would have the id. I’ve done this a few times in some of the sites I’ve built.

              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
              • 30564
              • 60 Posts
              ^ Thanks for the prompt clarification, I was looking at this on the basis of a row being the resultant, not the element, as you correctly surmised.

              Off to do battle on the morrow, it’s a bit late here now in Bangkok.

              Regards