I have this code in top.phtml which displays my menu items in my Magento store:
<div class="header-nav-container">
<div class="header-nav">
<h4 class="no-display"><?php echo $this->__('Category Navigation:') ?></h4>
<ul id="nav">
<li <?php if(!Mage::registry('current_category')) { echo 'class="level0 active"'; } else { echo 'class="level0"'; } ?>><a href="<?php echo $this->getUrl('') ?>"><span><?php echo $this->__('Home') ?></span></a></li>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php echo $this->drawItem($_category) ?>
<?php endforeach ?>
<li <?php if(!Mage::registry('current_category')) { echo 'class="level0 active"'; } else { echo 'class="level0"'; } ?>><a href="<?php echo $this->getUrl('catalogsale')?>"><span><?php echo $this->__('Sale Items') ?></span></a></li>
</ul>
</div>
I have an extra li
at the bottom which displays another page. The problem I have occurs when I click the ‘Sales Item’ page: its link becomes active but so does the home page link. How can I prevent the home page link from appearing active?
I’ve added a screenshot to show the problem: Screenshot