I have a hard-coded menu in Drupal (as it's too complex for the standard Menu system in Drupal).
I would like to be able to say: If this page is contained within the /about/ directory, apply the class "active", so that all new pages created within this directory automatically highlight the current section.
Currently I have:
$current_page = $_SERVER['REQUEST_URI'];
<ul class="main">
<li class="home"><a href="<?php echo $base_path?>">Home</a></li>
<li class="about
<?php if ($current_page == "/xxxxxxx.com/dev/about/")
{
echo "active";
}
?>"><a href="javascript:void(0)">About</a></li>
<li class="services"><a href="javascript:void(0)">Services</a></li>
<li class="work"><a href="javascript:void(0)">Work</a></li>
<li class="awards"><a href="javascript:void(0)">Awards</a></li>
<li class="environment"><a href="javascript:void(0)">Environment</a></li>
<li class="contact"><a href="javascript:void(0)">Contact</a></li>
</ul>
I have tried a few variations of strpos and explode to get the right variable, but with no luck so far.
Thanks :)