Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url

Get Url in CMS and Static Blocks

To get SKIN URL

{{skin url='images/testimage.jpg '}}

To get Media URL

{{media url='/testimage.jpg'}}

To get Store URL

{{store url='mypage.html'}}

To get Base URL

{{base url='mystore/mypage.html'}}

Get Url in Phtml

Not secure Skin URL

 
echo $this->getSkinUrl('images/sampleimage.jpg')

Secure Skin URL

echo getSkinUrl('images/ sampleimage.gif', array('_secure'=>true))

Get Current URL

$current_url = Mage::helper('core/url')->getCurrentUrl();

Get Home URL

$home_url = Mage::helper('core/url')->getHomeUrl();

Get Magento Media URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

Magento Skin URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

Get Magento Store URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

Get Magento Js URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

Leave a Reply

Your email address will not be published. Required fields are marked *