How to add top link in via custom module
-
06-10-2020 - |
Pergunta
How to Add top link after "My Wishlist". The link should be visible on activating my custom module.I'm using Magento 1.9. I added the following
<reference name="top.links">
<action method="addLink" translate="label title" module="mymodule">
<label>My Link</label>
<url helper="mymodule/quote/history/"/>
<title>My Link</title>
<prepare>true<prepare/>
<position>2</position>
</action>
</reference>
Solução
You can do this by (This is my complete module's layout file):
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Custom Home Link</label>
<url>home</url>
<title>Custom Home Link</title>
<prepare/>
<urlParams/>
<position>10</position>
</action>
</reference>
</default>
</layout>
Outras dicas
Please add this local.xml or any other module xml over fronted layout folder.
<default>
<!-- Mage_Customer -->
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
</default>
Also you can follow below links for the same.
URL : http://excellencemagentoblog.com/blog/2011/09/07/magento-add-top-links-in-magento/
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange