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 to call external images? 
 
Tiff
Sr. Member
 
Avatar
Total Posts:  107
Joined:  2008-03-25
Upstate NY
 

I want to put a big picture on my homepage, and some cool little graphics within item descriptions… is there a specific way to call images in Magento? 

I can’t use

<img src="...">
so I’m not sure what to do. 

I can put these images in my template’s skin/...../ images/media folder but no clue how to call them within the pages.

Thanks for your help!

-Tiff

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mageho
Sr. Member
 
Avatar
Total Posts:  291
Joined:  2008-03-24
France, Paris
 

Hi Tiff,

If your are using CMS Page, you can call image with

{{skin url="path_to_my_image"}}

If it’s in template file, you have to do :

$this->getSkinUrl('my_path_to_my_image');

It’s not more complicated !
I want to ask something too,
Can we call image via same methods in product description ?

Cheers,
Ilan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tiff
Sr. Member
 
Avatar
Total Posts:  107
Joined:  2008-03-25
Upstate NY
 

Ilan,

I tried your method but it doesn’t work for me.
I entered the code in the CMS page from admin.

Frontend shows me a URL for the graphic but not the graphic.

Snapshot attached. 

Thanks,

Image Attachments
images_not_working.gif
 
Magento Community Magento Community
Magento Community
Magento Community
 
Tiff
Sr. Member
 
Avatar
Total Posts:  107
Joined:  2008-03-25
Upstate NY
 

OK I got it working.  Here’s how:

As long as the image is in a directory OUTSIDE OF the magento directory, you can simply call it using a full HTML path and the img src tag.

So when I did this:

<img src="http://mydomain/my_images_folder/my_file.jpg">

it displayed exactly as I had wanted it.  I didn’t need any other attributes like width or height either.

No need for PHP on this one.

Woohoo!

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