We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27855
    • 21 Posts
    Hello,

    I would like to create a horizontal list and use it as my menu. I would like the current page to be marked in some way (highlight, bold...).

    I know how to do this when building sites the "traditional" way, but I’ve run into a problem trying to do it in a MODx template.

    I am using the Andreas02 template on my site: http://www.espanolathome.com and my simple menu is at the top.

    I changed the navigation and would like to use a simple horizontal list. I would like the ’current page’ to be marked in some way similar to this:

    HTML
    <div id="navcontainer">
    <ul id="navlist">
    <li id="active"><a href="#" id="current">Item one</a></li>
    <li><a href="#">Item two</a></li>
    <li><a href="#">Item three</a></li>
    <li><a href="#">Item four</a></li>
    <li><a href="#">Item five</a></li>
    </ul>
    </div>
    
    CSS
    #navlist li
    {
    display: inline;
    list-style-type: none;
    padding-right: 20px;
    }


    The problem is that with the template I am using, my menu is in a ’chunk’ which is in the ’template’, so I can’t create
    <li id="active"><a href="#" id="current">Item one</a></li>
    on each individual page. The menu also links to one of my other sites, so I don’t think I can use a menu that relies on the ’ids’ listed in the document tree.

    Does anyone know of a way I could make a simple horizontal list like this one http://css.maxdesign.com.au/listamatic/horizontal01.htmhttp://css.maxdesign.com.au/listamatic/horizontal01.htm using MODx?

    Sincerely,
    Sam

      • 7923
      • 4,213 Posts
      Have you tried something like:
      <div id="navcontainer">
      [!DropMenu? &hereClass=`active` &topnavClass=`navlist` &selfAsLink=`1` &levelLimit=`1`!]
      </div>


      Edit: This could also be usefull for you. Also look here.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."