In this article we will see; in Magento how we can get Skin, Media and Other URLs in Static block and .phtml file.
In one of the earlier article we have seen 4 ways to get Magento Homepage URL. Now in this article we will see how to get Skin, Media URL in .phtml file and static block.
So Let’s start with the Static block first:
Get Media URL in Static Block – Magento
If you want to get something added after media URL then you just need to place below code instead.
Get Skin URL in Static Block – Magento
If you want to get something added after skin URL then you just need to place below code instead.
Get Homepage URL in Static Block – Magento
{{config path="web/unsecure/base_url"}}
<!-- Secure URL -->
{{config path="web/secure/base_url"}}
Get Skin URL in .phtml File – Magento
echo $this->getSkinUrl('');
// Secure URL
echo $this->getSkinUrl('', array('_secure'=>true));
// If you want something added behind the URL
echo $this->getSkinUrl('image.jpg');
Get Media URL in .phtml File – Magento
Stay tuned with us on Twitter, Facebook and Email for more tips and tricks for magento.