Khawar Khalid
Khawar Khalid

Reputation: 11

Magento - Adding image in XML Layout File

I want to add an image in my XML Layout File in Magento theme. I have tried many things but they didn't work. I have following code to modify:

<action method="addLink" translate="label title" module="groupdeals" ifconfig="groupdeals/facebook_connect/enabled"><label>Login with Facebook</label><url helper="groupdeals/getConnectUrl"/><title>Connect with Facebook</title><prepare/><urlParams/><position>110</position><liParams/><aParams><rel>facebook-connect</rel></aParams></action>  

What I want is to replace "Login with Facebook" text with an image. Image is on my website root i.e. www.myweb.com/login.png.

I would be thankful if someone could help me in this matter.

Thanks

Dr. Khawar

Upvotes: 1

Views: 2738

Answers (2)

James Anelay
James Anelay

Reputation: 392

Pesonally I would change

<aParams><rel>facebook-connect</rel></aParams>

to

<aParams><rel>facebook-connect</rel><class>facebook-connect</class></aParams>

then hide the text with css and app a background image.

Upvotes: 1

erwin_smit
erwin_smit

Reputation: 700

You should be able to do this with a core/text block. For example:

<block type="core/text" name="facebook-link">
            <action method="addText">
                <text>
                    <![CDATA[
                    <a href="#"><img src="/login.png" /></a>
                    ]]>
                </text>
            </action>
</block>

Upvotes: 1

Related Questions