1

I have added a top.link and want to include an image inside the label. I'm not sure how to get the current_skin/images folder from within my local.xml though.

This is what I have so far

        <action method="addLink" translate="label title">
            <label><![CDATA[<img src="current_skin/images/image.svg">]]> Klantenservice</label>
            <url>klantenservice</url>
            <title>Klantenservice</title>
        </action>
1

You can achieve this by following method

<action method="addLink" translate="label title" module="yourmodule">
    <label helper="yourmodule/yourfunction"/>
    <url>klantenservice</url>
    <title>Klantenservice</title>
</action>

And in your module helper file (To create custom module refer this)

app/code/local/{namespace}/{module}/Helper/Data.php

Write a function to get the label dynamically.

public function yourfunction()
{
   return "<img src='".Mage::getDesign()->getSkinUrl('images/logo.gif')."'/>".$this->__('Klantenservice');
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.