I have some custom module, on activating this module I want to show a "Custom Module Link" as a top link. Please refer the snapshot below.
How can I achieve this? This link should redirect to one of the Customer account navigation link.
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>
<url>
tag?? @sree
Commented
Feb 28, 2017 at 8:35
<default><reference name="top.links"><action method="addLink" translate="label title"><label>Custom</label><url>MyModule/customBlock/customFile/</url><title>Custom</title><prepare/><urlParams/><position>10</position></action></reference></default> <customer_account> <reference name="customer_account_navigation"><action method="addLink" translate="label" module="MyModule"> <name>MyModule_customBlock_customFile</name> <path>MyModule/customBlock/customFile/</path> <label>Custom</label> </action> </reference> </customer_account>
Commented
Feb 28, 2017 at 8:49
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>
<default><reference name="top.links"><action method="addLink" translate="label title"><label>Custom</label><url>MyModule/customBlock/customFile/</url><title>Custom</title><prepare>true<prepare/><urlParams/><position>2</position></action></reference></default> <customer_account> <reference name="customer_account_navigation"><action method="addLink" translate="label" module="MyModule"> <name>MyModule_customBlock_customFile</name> <path>MyModule/customBlock/customFile/</path> <label>Custom</label> </action> </reference> </customer_account>
Commented
Feb 28, 2017 at 9:45