xciza
January 14, 2013, 2:15pm
1
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
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
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
xciza
January 15, 2013, 8:49am
5
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.
xciza
January 15, 2013, 9:27am
7
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:
great - works all fine, even tab “Kontakt” now
Thanks for sharing to the community and the next one seeking for a solution.