Home » Magento eCommerce

Adding Links to your Top Menu

28 June 2009 One Comment

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. Adding your Logo to your Magento Store
  5. Magento and Wordpress

One Comment »

  • Rahma said:

    Thank you for this! Simple yet concise.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree

Security Code: