Magento – Get URL Paths for Skin, Media, JS, Base & Store URL
Tips to get Magento URL paths of skin, Media, JS, Base and Store URL in CMS pages for Magento customization or programming. How we can retrieve URL path from static blocks in CMS, PHP and phtml pages
To Retrieve URL path in STATIC BLOCK
To get SKIN URL
{{skin url='images/sampleimage.jpg '}}
{{media url='/sampleimage.jpg'}}
{{store url='mypage.html'}}
{{base url='yourstore/mypage.html'}}
To Retrieve URL path in PHTML Note: In editing PHTML don’t forget to enclode the following code with PHP tag
Not secure Skin URL
<?php echo $this->getSkinUrl('images/sampleimage.jpg') ?>
<?php echo $this->getSkinUrl('images/ sampleimage.gif', array('_secure'=>true)); ?>
$current_url = Mage::helper('core/url')->getCurrentUrl();
$home_url = Mage::helper('core/url')->getHomeUrl();
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
阅读其他美文