Adding CSS Class name to my account link in magento through XML Layout
At the first instance I thought WTH! must be pretty simple, add params in XML layout . But later I found that it was not simpler as I thought. I had to get into the addLink method for sometime and finally I came up with correct structure of XML layout. At the end it again seemed simple though, but it needed a healthy effort.
Here’s the XML structure of layout from customer.xml where you add class to my account link.
<!-- customer.xml--> <reference name="top.links"> <action method="addLink" translate="label title" module="customer"> <label>My Account</label> <url helper="customer/getAccountUrl"/> <title>My Account</title>
<prepare/> <urlParams/> <class/> <position>10</position> <aParams> <class>my-class-name</class> </aParams> </action> </reference><!-- customer.xml-->One notable thing in the structure above is the aParams which is responsible for adding the class to the Anchor tag, not the List tag. Hope this helps someone! Happy Coding.

