Home Magento eCommerce

Adding Links to your Top Menu

28 June 2009 3 Comments

Many people wonder how you go by adding additional links to your Category menu items on Magento. This is another straight forward tutorial and will break it down for you to make it as simple as possible.

To get started you will need to locate and open “app/design/frontend/default/<yourtheme>/template/catalog/navigation/top.phtml” file. Once opened, scroll down and you will see something that sort of look like this:

<ul id="nav">
	<li><a href="<?php echo $this->getUrl('')?>"><span>
        <?php echo $this->__('Homepage') ?></span></a></li>
        <?php foreach ($this->getStoreCategories() as $_category): ?>
        <?php echo $this->drawItem($_category) ?>
        <?php endforeach ?>
</ul>

As you can see the Homepage link is an additional link I have added as an example. Now I will show you what it will look like to add a new additional link after the categorie links are shown:

<ul id="nav">
	<li><a href="<?php echo $this->getUrl('')?>"><span>
        <?php echo $this->__('Homepage') ?></span></a></li>
        <?php foreach ($this->getStoreCategories() as $_category): ?>
        <?php echo $this->drawItem($_category) ?>
        <?php endforeach ?>
        <li><a href="http://yourdomain.com/"><span>
        <?php echo $this->__('New Link Here') ?></span></a></li>
</ul>

This way you can now change “http://yourdomain.com” to destination you would like to choose aswell as ‘New Link Here’ to the name of the link you would like to use.

To remove any of the additional links just delete the starting and ending tags of the links, for example:

<ul id="nav">
        <?php foreach ($this->getStoreCategories() as $_category): ?>
        <?php echo $this->drawItem($_category) ?>
        <?php endforeach ?>
</ul>

From hellothemes.com

Related posts:

  1. Adding Links to Magento Menu Bar
  2. Magento Navigation, how to customize very helpful information?
  3. Magento Vertical Category Menu
  4. Magento and Wordpress
  5. Adding your Logo to your Magento Store

3 Comments »

  • Rahma said:

    Thank you for this! Simple yet concise.

  • NEHA said:

    Thanx for providing such a simple code to implement the above topic in magento site.it worked…

  • ape said:

    Thank you greatly for the simple solution. Fast and to the point.
    We appreciate it.

    ape