Pages

Sunday, September 14, 2014

How to get Magento Urls

(for my own reference)

Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url Get Url in phtml files

  • Base Url : Mage::getBaseUrl(); 
  • Skin Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); 
  • Unsecure Skin Url : $this->getSkinUrl('images/image_name.jpg'); 
  • Secure Skin Url : $this->getSkinUrl('images/image_name.gif', array('_secure'=>true)); 
  • Media Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); 
  • Js Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); 
  • Store Url : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); 
  • Current Url Mage::helper('core/url')->getCurrentUrl(); 

Urls in cms pages or static blocks

  • Base Url : {{store url=""}} 
  • Skin Url : {{skin url='images/image_name.jpg'}} 
  • Media Url : {{media url='/image_name.jpg'}} 
  • Store Url : {{store url='somepage.html'}}

No comments:

Post a Comment