We launched new forums in March 2019β€”join us there. In a hurry for help with your website? Get Help Now!
    • 8439
    • 89 Posts
    A common technique for indicating which section you are in within a site is to highlight the link used to get you there.

    Something like
    ...
    <div id="subnavcurrent">section 1</div>
    <div id="subnav"><a href="sec2.htm">section 2</a></div>
    <div id="subnav"><a href="sec3.htm">section 3</a></div>
    <div id="subnav"><a href="sec4.htm">section 4</a></div>
    ...

    sec2.htm has
    <div id="subnav"><a href="sec1.htm">section 1</a></div>
    <div id="subnavcurrent">section 2</div>
    ...
    and so on.

    This is part of a larger template. One way is to define N chunks containing the above extract where each has a different link set to the subnavcurrent id. How would I specify this within a template such that when creating a document I could enter the appropriate chunk. What is the MODx way of achieving this?

    Ed
      • 28042 β˜† A M B β˜†
      • 24,524 Posts
      Most of the menu snippets do this automatically. Check the optional arguments listed in the beginning of the snippet code. Adjust your CSS file accordingly.
        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
        • 25663 MODX Staff
        • 12,272 Posts
        And use Wayfinder if at all possible. It’s infinitely easier to get the exact output you want.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me