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 simply call an image from a phtml page. 
 
richardsb
Sr. Member
 
Total Posts:  109
Joined:  2009-11-30
 

hi guys,

I have installed twitter onto my home page but want to add speech marks either end....?
got the image, just need to call it.

looked through loads of files but none seem to call images in this manor.

TIA

Richard

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kara Heinrichs
Guru
 
Avatar
Total Posts:  482
Joined:  2008-01-17
aa, mi, us
 

from within a PHTML file you can reference a file in the skin/yourpackage/default/images directory using:

<?php echo $this->getSkinUrl('images/icon.gif'); ?>

from within a CMS block the call would be:

{{skin url="images/icon.gif"}}
 
Magento Community Magento Community
Magento Community
Magento Community
 
tigerofasia
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2010-07-11
 
kara - 29 March 2010 01:08 PM

from within a PHTML file you can reference a file in the skin/yourpackage/default/images directory using:

<?php echo $this->getSkinUrl('images/icon.gif'); ?>

from within a CMS block the call would be:
{{skin url="images/icon.gif"}}

GREAT! Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Adam1991
Jr. Member
 
Total Posts:  19
Joined:  2013-01-08
 

Sorry I know this post is REALLY old but this isn’t working for me…

I’m trying to edit the form-mini.phtml file so that instead of having the text ‘search’ on the search butto I will have a search icon but it isn’t working.

On the front-end, all i am getting is a reference to where the image is rather than it calling up the actual image.

My code is…

<button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><?php echo $this->getSkinUrl('images/search_btn_mag.gif'); ?></span></button>

Any help would be greatly appreciated, i’m pulling out my hair here! smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
krdcabinets
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2011-10-14
 
Adam1991 - 20 February 2013 04:25 PM

Sorry I know this post is REALLY old but this isn’t working for me…

I’m trying to edit the form-mini.phtml file so that instead of having the text ‘search’ on the search butto I will have a search icon but it isn’t working.

On the front-end, all i am getting is a reference to where the image is rather than it calling up the actual image.

My code is…

<button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><?php echo $this->getSkinUrl('images/search_btn_mag.gif'); ?></span></button>

Any help would be greatly appreciated, i’m pulling out my hair here! smile

Get rid of this guy ; so it looks like:

<button type="submit" title="<?php echo $this->__('Search') ?>” class="button"><span><?php echo $this->getSkinUrl('images/search_btn_mag.gif') ?></span></button>

 
Magento Community Magento Community
Magento Community
Magento Community
 
sudobash29
Jr. Member
 
Total Posts:  6
Joined:  2013-04-23
 

Can I call an Image based on the product that I selected and display It on a static block on the product page?, I made an attribute for the Image Scope-Store View, Catalog Input Type for Store Owner-media image, Apply To-all product types then inserted it on all attribute sets, then I uploaded the image, then I want to call it on a static block on a their respective product pages. Is that possible?.

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