Magento: Get Skin Url

If you need to get the skin url, the most common place you’d need to get it is from within a template file. If that is the case for you, this is how you can do it:

echo $this->getSkinUrl('images/your-image.jpg');

But, if you don’t happen to be within a template file where $this is not available, there is another way to do it (which actually $this->getSkinUrl() does anyway):

echo Mage::getDesign()->getSkinUrl('images/your-image.jpg');
This entry was posted in Magento. Bookmark the permalink.

2 Responses to Magento: Get Skin Url

  1. blair says:

    thanks! searched for hours trying to figure out how to getSkinUrl without using $this.

  2. HotCustard says:

    Many thanks, this page came near the top in G for a search on the magento skin url so i will no doubt be back here again soon when I next forget the syntax. :)