Magento Active states in TOP MENU


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $_currentUrl = Mage::helper('core/url')->getCurrentUrl();
  3. $_homeUrl = Mage::helper('core/url')->getHomeUrl();
  4. ?>
  5. <div class="nav-container">
  6. <ul id="nav">
  7. <?php echo $_menu; ?>
  8. <li class="level0 nav-1 level-top <?php if ($_currentUrl === $_homeUrl.'contact'):?> active<?php endif;?>"><a href="<?php echo $this->getUrl('contact')?>"><?php echo $this->__('Contact Us') ?></a> </li>
  9. </ul> </div>
  10.  
  11.  
  12. <?php endif ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.