Quantcast
Channel: Tutorial Magento » Magento Blog
Viewing all articles
Browse latest Browse all 6

How to add “Home” link to Magento top menu

$
0
0

By default, there’s no Home link in top Menu of your Magento site, but you can easily add it to top menu to let visitors quickly navigate to your Homepage.

There’re 2 steps to add Home link to top Menu of Magento:

 

1- Copy following 2 files

design/frontend/base/template/page/html/topmenu.phtml
design/frontend/base/template/catalog/navigation/top.phtml

To

design/frontend/default/yourtheme/template/page/html/topmenu.phtml
design/frontend/default/yourtheme/template/catalog/navigation/top.phtml

2. Replace the existing code with the following code

<?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>
<div class="nav-container">
    <ul id="nav">
         <!-- HOME BUTTON HACK -->
        <?php $_anyActive = false; foreach ($this->getStoreCategories() as $_category) { $_anyActive = $_anyActive || $this->isCategoryActive($_category); } ?>
        <li class="<?php echo !$_anyActive ? 'active' : '' ?>"><a href="<?php echo $this->getUrl('')?>"><?php echo $this->__('Home') ?></a></li>
        <!-- HOME BUTTON HACK -->
        <?php echo $_menu ?>
    </ul>
</div>
<?php endif ?>
Now refresh your site and you will see Home link in top menu of your Magento site

The post How to add “Home” link to Magento top menu appeared first on Tutorial Magento.


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images