Adding Top Link via a custom module - Magento 1.9
-
06-10-2020 - |
解决方案
Try this
<default>
<reference name="top.links">
<action method="addLink" translate="label title"><label>Custom</label><url>YOUR_URL_KEY</url><title>Custom</title><prepare/><urlParams/><position>10</position></action>
</reference>
</default>
其他提示
Top-links are generaly managed in Magento through layout.xml
files. To add a link to top links, you need to add an xml code to layout files.
Please refere to this http://excellencemagentoblog.com/blog/2011/09/07/magento-add-top-links-in-magento/
EDIT:
Please put this code under <reference name="top.links">
and before closing tag </reference>
in your local.xml
<action method="addLink" translate="label title">
<label>Your label module</label>
<url>your custom url</url>
<title>Your title module</title>
<prepare>true</prepare>
<position>2</position>
</action>