3. Magento. How to edit header links
2 min read- In case you just need to alter the Header Links Title, you can do so by using Magento Translate Inline tool. Login to your Magento Admin panel and go to System -> Configuration.
- Scroll down and click the Developer menu item.
- Click Translate Inline tab and select YES from the drop down Enabled for Frontend option.
Save Config and reload your site:
- Now you can select any item to alter the text/title. Note that the actual URL/link will remain the same.
- You might also need to add or remove items from the header section.
In order to remove or add header/top links, connect to your server using FTP client or access your file manager from the hosting control panel.
- Go to the app/design/frontend/base/default/layout folder.
Download the following files:
- checkout.xml
- customer.xml
- wishlist.xml
You may need these files to perform the changes.
- Now go to the theme folder, which is currently enabled on your site. app/design/frontend/tm_themes/themeXXX/layout. Open local.xml file using a text editor.
- We are going to perform changes in the <default> section.
- In this example, we will remove the Wishlist item. The following code should be used:
1<remove name=”wishlist_link”/>
- We need to place the code within top.links reference.
- The final code will look like that:
123<reference name=”top.links”><remove name=”wishlist_link”/></reference>
- Save this file and upload to the server.
- Now, let’s add one item for the Home page.
The following code should be used:
<action method=”addLink” translate=”label title” module=”customer”>
<label>Home</label>
<url>home</url>
<title>Home</title>
<prepare/>
<urlParams/>
<position>10</position>
</action>
where URL value is your actual URL/link.
- Now let’s remove the cart link.
- Open checkout.xml file which we’ve downloaded from the Default Magento theme.
Here we can find out the name of the block, which is checkout_cart_link.
Using the same method, we can remove the “cart” link from the header links section:
1<remove name=”checkout_cart_link” />
Now you know how to alter header/top links in Magento templates.
Thank you for reading this tutorial!