In my template I want to display an image.

  1. How can I do it?
  2. Where do I place my image?
  3. How can the path of to image be specified in template file (pattern)?

You have 2 options here.
If the image must be theme dependent just put the image in skin/frontend/{package}/{theme}/images/image.jpg and put this in your template:

<img src="<?php echo $this->getSkinUrl('images/image.jpg')?>" alt="" />

If the image should be the same for all themes just place it in the media folder. You can even use a subfolder to for easier management. media/some_folder/image.jpg. Then add this to your template:

<img src="<?php echo Mage::getBaseUrl('media').'some_folder/image.jpg')?>" alt="" />

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.