I have menu.php in /snippets folder and include it using
At the top of each site page I have
And in menu,php i have my menu shown as
The active class works if menu.php is in the code for each page but not if I embed it as above
Any ideas?
(Hope i explained that ok!)
Thanks
- Code: Select all
<cms:embed 'menu.php' />
At the top of each site page I have
- Code: Select all
<?php $currentPage = 'home'; ?>
And in menu,php i have my menu shown as
- Code: Select all
<li class="<?php if($currentPage =='home'){echo 'active';}?>"><a href="index.php">Home</a></li>
The active class works if menu.php is in the code for each page but not if I embed it as above
Any ideas?
(Hope i explained that ok!)
Thanks