Wednesday 1 July 2015

Magento Add a link to top links or remove a link from top links

Add a link to top links via layout xml, for instance in the theme's local.xml

   <customer_logged_out>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>Create an Account Imediately</label><url helper="customer/getRegisterUrl"/><title>Create an Account Imediately</title><prepare/><urlParams/><position>10</position></action>
        </reference>
        <remove name="reorder"></remove>
    </customer_logged_out>
note: this is for unsigned-in user, if you search addLink in the app/design folder, there will be more for specific pages. 

Remove a link from top links via layout xml

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

No comments:

Post a Comment