menu css
4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: October 14, 2010 (RSS)
By Maurice - October 14, 2010
Any one got a smart way to see what page is active so i can tel my css/class menu that it must be active???
-------------------------------------------
Dropmonkey.nl
Dropmonkey.nl
Re: [Maurice] menu css
By Chris - October 14, 2010
Hi Maurice,
I usually use preg_match() to check the URL path, like this:
Does that help? Please let me know if you have any questions.
I usually use preg_match() to check the URL path, like this:
<ul>
<li><a href="/foo/" class="<?php echo preg_match('|/foo|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Foo</a></li>
<li><a href="/bar/" class="<?php echo preg_match('|/bar|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Bar</a></li>
<li><a href="/baaz/" class="<?php echo preg_match('|/baaz|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Baaz</a></li>
<li><a href="/quux/" class="<?php echo preg_match('|/quux|', $_SERVER['SCRIPT_NAME']) ? 'active' : 'inactive' ?>">Quux</a></li>
</ul>
Does that help? Please let me know if you have any questions.
All the best,
Chris
Chris
Re: [chris] menu css
By Maurice - October 14, 2010
cool
great this is super...
do u also have a solution for breadcrumbs hahahah
great this is super...
do u also have a solution for breadcrumbs hahahah
-------------------------------------------
Dropmonkey.nl
Dropmonkey.nl
Re: [Maurice] menu css
By Chris - October 14, 2010
Hi Maurice,
Glad to help! :)
I find I usually have to hardcode breadcrumbs.
Glad to help! :)
I find I usually have to hardcode breadcrumbs.
All the best,
Chris
Chris