Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Joomla/php Question

Options
  • 22-10-2008 8:12pm
    #1
    Registered Users Posts: 7,468 ✭✭✭


    Hello,

    I'd like to change the code for mod_mainmenu but am both a php and joomla noob :o .

    So I'm using the topmenu to navigate my site, the menu is rendered as a horizontal list. The HTML for the list items is rendered with an id of current for the current page. Grand so far (I've found where this happens in the code too).

    What I'd like to do is take 'current' from the list item id and add it as a class attribute to the anchor within that list item.

    So currently my list items are rendered as
    <li id="current" class="active item28">
       <a href="/foo/index.php?option=com_content&view=frontpage&Itemid=28">
          <span>Home</span>
       </a>
    </li>
    

    And I like to render them as
    <li class="active item28">
       <a href="/foo/index.php?option=com_content&view=frontpage&Itemid=28" class="current" >
          <span>Home</span>
       </a>
    </li>
    

    Could somebody give me a pointer as to where and how I would add the class to the link? I can already remove the id from the list item.

    This is for Joomla 1.5.7 running on Wamp with PHP v5.2.5 and I'm using the production version of Joomla, not a nightly build.


Comments

  • Registered Users Posts: 342 ✭✭adm


    perhaps a dumb question but why do you want to do that?

    can't you just reference the anchor in css like so

    li#current a{..}


Advertisement