Current page effect

Hi,
I have this menu on my site:


<ul>

                                    <li><a href="[{ $oViewConf->getHomeLink() }]" class="current">Home</a></li>
                                    
                                    [{oxifcontent ident="oxagb" object="oCont"}]
                                    <li><a id="test_link_footer_terms" href="[{ $oCont->getLink() }]" rel="nofollow">[{ $oCont->oxcontents__oxtitle->value }]</a></li>
                                    [{/oxifcontent}]
                                    <li><a href="[{ oxgetseourl ident=$oViewConf->getSelfLink()|cat:"cl=contact"}]">[{ oxmultilang ident="INC_FOOTER_CONTACT" }]</a></li>
                                </ul>

I would like to have on current page the same effect like on hover (in menu). I tried CSS a:active{style} but it isn’t working.
Please, how to style current page in menu?
I hope that you understand what i need to do :slight_smile:

Thanks

Hi,
Try this:


    <ul>
      <li><a href="[{ $oViewConf->getHomeLink() }]" [{if $homeSelected == 'true'}]class="current"[{/if}]>Home</a></li>
      [{assign var="currentPage" value="http://"|cat:$smarty.server.HTTP_HOST|cat:$smarty.server.REQUEST_URI}]
      [{oxifcontent ident="oxagb" object="oCont"}]
      <li><a [{ if $currentPage|htmlspecialchars == $oCont->getLink() }]class="current"[{/if}] id="test_link_footer_terms" href="[{ $oCont->getLink() }]" rel="nofollow">[{ $oCont->oxcontents__oxtitle->value }]</a></li>
      [{/oxifcontent}]
      <li><a href="[{ oxgetseourl ident=$oViewConf->getSelfLink()|cat:"cl=contact"}]">[{ oxmultilang ident="INC_FOOTER_CONTACT" }]</a></li>
  </ul>  

Regards

Not working :frowning:

Good morning,
it works. I’ve just tested.

You want the “HOME” and “AGB”, If you click on it is a different css class?

Do you already have [B].current[/B] class in oxid.css Defined? TMP folders emptied?


.current {font-weight:bold; color:red;}

Regards

Yes i have everything bud not working.
If I use developer console in internet browser, there is no class “current” on the menu item.

I have hover style on menu item and I would like to have the same effect if the page is active, but mouse isn’t on menu item.

try css selector :hover

CSS selector :hover works. That i know. But it isn’t for active page, it is for hover effect. I tried CSS selector :active but it isn’t working. I need something like this:


<li><a href="[{ $oViewConf->getHomeLink() }]"  [{if isCurrent}] class="current"[{/if}]>Home</a></li> for everything menu item

ok, now i got it.
have a look at this thread:

happy i could help :slight_smile: