We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32156
    • 2 Posts
    New to MODx, so far I’m liking it... but I’m stuck on writing an if statement for my template. Here’s what I’m trying to accomplish: (If I’m on the About page, I want to output a class - I’m using this for my menu)

    If Page = ’About’ Then Print ’class="active"’

    How do I do this?

      • 22840
      • 1,572 Posts
      How is your menu being generated ??

      If you use Wayfinder for the menu then it gives the active class to the page that you are on and also a class of first and last to the relevant menu items
        • 32156
        • 2 Posts
        yeah I’m not using the wayfinder method. how do I go about using the wayfinder method? my menu looks like this:

        <ul id="menu">
        <li class="active">Home</li>
        <li>Product</li>
        <li>About</li>
        <li>News</li>
        <li>Contact</li>
        <li>Subscribe</li>
        </ul>
          • 22840
          • 1,572 Posts
          It’s pretty straight forward.

          http://svn.modxcms.com/docs/display/ADDON/Wayfinder

          You will have to use a outer template to give the ul the class.