Get Base URL,Current URL,Skin URL,Store URL,Js URL: Magento

Get Base URL,Current URL,Skin URL,Store URL,Js URL: Magento

This post will help you to get Base URL, Current URL, Skin URL, Store URL, Js URL, Media URL in phtml files, CMS pages and static blocks.

Get URL in phtml files:

1. Base URL

Mage::getBaseUrl();

2. Skin URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

a)Unsecure Skin URL

$this->getSkinUrl(‘css/styles.css’);

b)Secure Skin URL

$this->getSkinUrl(‘css/styles.css’, array(‘_secure’=>true));

3. Js URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

4. Current URL

Mage::helper(‘core/url’)->getCurrentUrl();

5. Store URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

6. Media URL

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

 

Get URL in CMS pages and Static Blocks:

1. Base URL

{{store url=“”}}

2. Skin URL

{{skin url=”css/styles.css”}}

3. Store URL

{{store url=”newpage.html”}}

4. Media URL

{{media url=”/imagename.png”}}

 

Please contact us at manish@bay20.com or call us at +91-8800519180 for any support related to Magento. You can also visit the Magento development page to check the services we offer.