ADD External Link ---
Where are the files for the links located
app\design\frontend\default\your_Theme\layout
- The “My Account” link is found in the customer.xml file
- The “My Wishlist” link is found in the wishlist.xml file
- The “My Cart” and “Checkout” links are both found in the checkout.xml file
- The “Login” and “Log Out” links are found in the customer.xml file
<reference name="top.links">
linking code is in here.. </reference>
.
----------------------------------------------------------------------
<reference name="top.links">
<action method="addLink" translate="label title">
<label>example</label>
<url>http://myotherexampledomain.com</url>
<title>example</title>
<prepare/>
<urlParams/>
<position>100</position>
<liParams/>
<aParams>class="top-link-example"</aParams>
<beforeText></beforeText>
<afterText></afterText>
</action>
</reference>
--------------------- Tested on Magento 1.5 ------------------
Basically, prepare needs to be unset because, if it is set to "true" or
"false", it will append the URL to your site's base URL.
(<prepare>true</prepare>) To append URL
Reordering Top links ----
Change or add position to links
reference
<reference name="top.links"> <action method="addLink" translate="label title"> <label>example</label> <url>http://myotherexampledomain.com</url> <title>example</title> <prepare/> <urlParams/> <position>100</position> <liParams/> <aParams>class="top-link-example"</aParams> <beforeText></beforeText> <afterText></afterText> </action> </reference>
Adding A Home link To the Top Links
You can add a link to your homepage by pasting in the code below in to your customer.xml file in the same place as above:<action method="addLink" translate="label title" module="customer">
<label>Home</label>
<url></url>
<title>Home</title>
<prepare>true</prepare>
<urlParams/>
<position>1</position>
</action>
Adding To The Top Links On Certain Pages Only
The examples so far have added the links to all the pages, if you wanted to add, say for instance, the “Shipping Terms” link only to your “My Cart” page you would paste the following code in your checkout.xml file:<reference name="top.links">
<action method="addLink" translate="label title">
<label>Shipping Terms</label>
<url>shipping</url>
<title>Shipping Terms</title>
<prepare>true</prepare>
<urlParams helper="core/url/getHomeUrl"/>
<position>2</position>
</action>
</reference>
No comments:
Post a Comment