PHTML文件中调用相关地址:
//获取 magento js 路径
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
//http://你网站地址/index.php/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
//获取 magento media 目录
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
//magento中 获取skin目录
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
//http://你网站地址/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
//获取当前页面URL地址
$currentUrl = $this->helper('core/url')->getCurrentUrl();
//首页地址
$home_url = Mage::helper(‘core/url’)->getHomeUrl();
//安全的Skin URL
$this->getSkinUrl(‘images/image.gif’, array(‘_secure’=>true))
STATIC Block中调用相关地址:
//Skin URL
{{skin url=’images/image.jpg ‘}}
//Media URL
{{media url=’/image.jpg’}}
//Store URL
{{store url=’mypage.html’}}
//Base URL
{{base url=’mystore/mypage.html’}}
|