Try the Demo

Magento Forum

   
add css class to Wishlist Link (Top)
 
MagePsycho
Mentor
 
Avatar
Total Posts:  1684
Joined:  2009-06-23
 

Hi Mage Lovers

I have one query regarding adding custom css class in wishlist link:

<reference name="top.links">
            <
block type="wishlist/links" name="wishlist_link"/>
            <
action method="addLinkBlock"><blockName>wishlist_link</blockName></action>
        </
reference>

Note: I tried the following code but didn’t work:

<reference name="top.links">
            <
block type="wishlist/links" name="wishlist_link"/>
            <
action method="addLinkBlock"><blockName>wishlist_link</blockName><aParams>class="my-wishlist"</aParams></action>
        </
reference>
&
<reference name="top.links">
            <
block type="wishlist/links" name="wishlist_link"/>
            <
action method="addLinkBlock"><blockName>wishlist_link</blockName><aParams>id="my-wishlist"</aParams></action>
        </
reference>

Thanks in advance.

 Signature 

MagePsycho - Magento Freelancer
Free Modules: jQuery LightBoxes | Frontend Links Manager & more…
Commercial Modules: jQuery Sliders Pro | Custom Login Redirect Pro | Store Restrction Pro & more...

Follow me on Twitter @ magepsycho

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  236
Joined:  2008-01-10
London
 

For “wishlist” top link I believe you would have to add css to links.phtml .

Similar to

http://www.magentocommerce.com/boards/viewthread/229259/

 
Magento Community Magento Community
Magento Community
Magento Community
 
magedziner
Sr. Member
 
Avatar
Total Posts:  246
Joined:  2009-09-02
 

To add custom css class in top Wishlist Link,
We need to add this :

<reference name="top.links">
              <
action method="addLink" translate="label title" module="wishlist"><label>My Wishlist</label><path>wishlist</path><title>My Wishlist</title><prepare/><urlParams/><position>2</position><li/><a>class="your-classname"</a></action>
        </
reference>

Hope this helps!

 Signature 

Expert Magento Designer/Developer
Magento Freelancer / Lead Frontend Developer at magepixel
PSD to Magento, PSD for Magento, Theme Customization, Theme Installation, Magento Installation, Magento Extension Development
Contact Me
http://www.magedziner.com
http://magepixel.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
magedziner
Sr. Member
 
Avatar
Total Posts:  246
Joined:  2009-09-02
 

To add custom css class in top Wishlist Link,
We need to add this :

<reference name="top.links">
              <
action method="addLink" translate="label title" module="wishlist"><label>My Wishlist</label><path>wishlist</path><title>My Wishlist</title><prepare/><urlParams/><position>2</position><li/><a>class="your-classname"</a></action>
        </
reference>

Hope this helps!

 Signature 

Expert Magento Designer/Developer
Magento Freelancer / Lead Frontend Developer at magepixel
PSD to Magento, PSD for Magento, Theme Customization, Theme Installation, Magento Installation, Magento Extension Development
Contact Me
http://www.magedziner.com
http://magepixel.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
flayeros
Jr. Member
 
Total Posts:  1
Joined:  2012-03-25
 

Here you go, two simple hacks to choose from.

1st: Just add in local.xml

<reference name="top.links">
     <
reference name="wishlist_link">                 
          <
action method="__set">
                 <
name>a_params</name><value>class="top-link-wishlist"</value>
          </
action>             
     </
reference>
</
reference>

2nd option would be:
go to app\code\core\Mage\Wishlist\Block\Links.php
and inside

public function initLinkProperties()

just after
$this->_title $text;

insert this line
$this->a_params 'class="top-link-wishlist"';

If you want to leave the core file intact, you can first copy it to app\code\local\Mage\Wishlist\Block\Links.php
Hope that helps! cool smile

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top