Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

how do i add a link to the image in my callout? 
 
ClaireC21
Jr. Member
 
Total Posts:  12
Joined:  2010-08-24
 

hi!

i’ve change the images and alt texts for my callouts in both the left and right column.

I want to add a link to these images… linking back to different pages on my own site. What should i add to the code?

this is what i have in app/design/frontend/default/mapple/template/callouts/right_col.phtml

<img src="<?php echo $this->getSkinUrl('images/media/paymentmode.jpg') ?>” alt="<?php echo __('Available Payment Modes') ?>” title="<?php echo __('Available Payment Modes') ?>” />

 
Magento Community Magento Community
Magento Community
Magento Community
 
JMJ Development
Member
 
Avatar
Total Posts:  40
Joined:  2008-08-07
Australia
 

Where are you trying to link to? a simple

<a href="www.yoursite.com/">image code</a>
will suffice.

You can then add you alt and title text to the a href also.

 
Magento Community Magento Community
Magento Community
Magento Community
 
saval
Member
 
Avatar
Total Posts:  36
Joined:  2010-11-16
India, Nagpur
 
ClaireC21 - 06 December 2010 11:28 PM

hi!

i’ve change the images and alt texts for my callouts in both the left and right column.

I want to add a link to these images… linking back to different pages on my own site. What should i add to the code?

this is what i have in app/design/frontend/default/mapple/template/callouts/right_col.phtml

<img src="<?php echo $this->getSkinUrl('images/media/paymentmode.jpg') ?>” alt="<?php echo __('Available Payment Modes') ?>” title="<?php echo __('Available Payment Modes') ?>” />

<a href="<?php echo $this->getUrl() ?>” title="<?php echo $_link->getTitle() ?>">your Image will be here</a>

For Example :- href="<?php echo $this->getUrl() ?>/your-page-name”

<a href="<?php echo $this->getUrl() ?>/your-page-name” title="<?php echo $_link->getTitle() ?>">
<img src="<?php echo $this->getSkinUrl('images/media/paymentmode.jpg') ?>” alt="<?php echo __('Available Payment Modes') ?>” title="<?php echo __('Available Payment Modes') ?>” /></a>

 
Magento Community Magento Community
Magento Community
Magento Community
 
ClaireC21
Jr. Member
 
Total Posts:  12
Joined:  2010-08-24
 

hi! thanks for the replies!

i tried it out and i got an error

Fatal error: Call to a member function getTitle() on a non-object in /home/flookdco/public_html/app/design/frontend/default/mapple/template/callouts/right_col.phtml on line 32

this is the code i have now:

<a href="<?php echo $this->getUrl() ?>/how-to-shop” title="<?php echo $_link->getTitle() ?>">
<img src="<?php echo $this->getSkinUrl('images/media/paymentmode.jpg') ?>” alt="<?php echo __('Available Payment Modes') ?>” title="<?php echo __('Available Payment Modes') ?>” /></a>

am i missing something?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JMJ Development
Member
 
Avatar
Total Posts:  40
Joined:  2008-08-07
Australia
 

Rather than trying to call a link title from nowhere you seem to know what you want the title text to be so just use the same method you have been using.

<a href="<?php echo $this->getUrl() ?>/how-to-shop” title="<?php echo __('Available Payment Modes'?>">
<img src="
<?php echo $this->getSkinUrl('images/media/paymentmode.jpg'?>” alt="<?php echo __('Available Payment Modes') ?>” title="<?php echo __('Available Payment Modes'?>” /></a>
 
Magento Community Magento Community
Magento Community
Magento Community
 
ClaireC21
Jr. Member
 
Total Posts:  12
Joined:  2010-08-24
 
JMJ Development - 07 December 2010 02:00 AM

Rather than trying to call a link title from nowhere you seem to know what you want the title text to be so just use the same method you have been using.

<a href="<?php echo $this->getUrl() ?>/how-to-shop” title="<?php echo __('Available Payment Modes'?>">
<img src="
<?php echo $this->getSkinUrl('images/media/paymentmode.jpg'?>” alt="<?php echo __('Available Payment Modes') ?>” title="<?php echo __('Available Payment Modes'?>” /></a>

hi!

i put the exact code in but now nothing shows up, not even the image.

 
Magento Community Magento Community
Magento Community
Magento Community
 
JMJ Development
Member
 
Avatar
Total Posts:  40
Joined:  2008-08-07
Australia
 

Can you post the whole script and the the source from the frontend?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ClaireC21
Jr. Member
 
Total Posts:  12
Joined:  2010-08-24
 

i managed to get it working! i just put the a href code minus all the php stuff and it worked! =) thank you for all your help!

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