Adding a link to top.links in magento.

      No Comments on Adding a link to top.links in magento.

I often need to add cms pages to the top links section of magento’s cms.

The best way I’ve found to do this is in the page.xml document for your theme. ¬†Where it says:

[code language=”xml”]
<block type="page/template_links" name="top.links" as="topLinks"/>
[/code]

Simply change it to:

[code language=”xml”]
<block type="page/template_links" name="top.links" as="topLinks">
<action method="addLink" translate="label title"><label>Home</label><url>/</url><title>Home</title><prepare/><urlParams/><position>1</position></action>
<action method="addLink" translate="label title"><label>Contact</label><url>/contact-us</url><title>Contact</title><prepare/><urlParams/><position>1000</position></action>
</block>
[/code]

The actions can be as many or few as you need for your theme.

Leave a Reply

Your email address will not be published. Required fields are marked *