Adding Classing/Icons to top links.

To add separate icons to each of the top links you first need to give each of the links an individual class, you could hard code these in but the best way is to add the class to the links using XML

I will use the my account link as an example.

Editing XML

Open customer.xml and on around line 52 you should find this line;

<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>

To add a class you need to do two things, close out the li params and add the a params (the class) so just before the </action> add <liParams/> and <aParams>class="your-class-name-here"</aParams>

The exception – Wishlist.

Magento handles the wishlist link a little differently choosing to use the addLinkBlock method instead of addLink to add this link. To add the class we need to change it back to addLink.

Replace the code <action method="addLinkBlock"><blockName>wishlist_link</blockName></action>

with

<action method="addLink" translate="label title" module="wishlist"><label>Wishlist</label><url helper="wishlist/getListUrl"/><title>My Wishlist</title><prepare/><urlParams/><liParams/><aParams>class="your-class-name-here"</aParams></action>

and the simply change the aParam class.



One Comment on "Adding Classing/Icons to top links."

  1. hey,
    your post was very helpfully for my actually webshop.
    In version 1.7.0.2 i needed to put “99″ into the new wishlist , otherwise the gets the class and not the .

Leave a Comment