Magento 1.9 – How to Add Custom Link to Top Link

magento-1.9toplinks

I want to add custom link in the 'top link' section(white list, Login, Account).

Basically i want to add "Blog" link at the top of the links. When user click on the link then its redirect to the external website.

My website URL is www.imageplus.pk.

Please help me how can i do this?

Best Answer

To add a new link just do this

Open app/design/frontend/default/TEMPLATE/layout/customer.xml

Add the following at the bottom before closing tag.

    <default>
    <reference name="top.links">
      <action method="addLink" translate="label title">
        <label>Blog</label>
        <url>YOUR-BLOG-URL</url>
        <title>Bloh</title>
        <prepare/>
        <urlParams/>
        <position>2</position>
        <liParams />
       <aParams><![CDATA[target="_blank"]]></aParams>
      </action>
    </reference>
    </default>

Just replace URL with your blog url

<customer_logged_out>
    <reference name="top.links">
        <action method="removeLinkByUrl">
            <url helper="customer/getRegisterUrl" />
        </action>
    </reference>
</customer_logged_out>
Related Topic