博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Magento: get skin url, get media url, get base url, get store url
阅读量:4201 次
发布时间:2019-05-26

本文共 1287 字,大约阅读时间需要 4 分钟。

Magento Mage Core, Admin Static Blocks, or Phtml edits are usually includes getting url path such images, javascript, base url, media and store url. There are different ways to retrieve mentioned URL paths depending on where section you’re editing.

To Retrieve URL path in STATIC BLOCK

To get SKIN URL

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

To get Media URL

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

To get Store URL

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

To get Base URL

{
{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:

getSkinUrl('images/sampleimage.jpg') ?>

Secure Skin URL

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_LINK);

Get Magento Media Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

Get 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);

 

转载地址:http://uncli.baihongyu.com/

你可能感兴趣的文章
Google Web工具包 GWT
查看>>
材料与工程学科相关软件
查看>>
MPI的人怎么用仪器
查看>>
windows 下AdNDP 安装使用
查看>>
Project 2013项目管理教程(1):项目管理概述及预备
查看>>
ssh客户端后台运行
查看>>
哥去求职,才说了一句话考官就让我出去
查看>>
【React Native】把现代web科技带给移动开发者(一)
查看>>
【GoLang】Web工作方式
查看>>
Launch Sublime Text 3 from the command line
查看>>
【数据库之mysql】mysql的安装(一)
查看>>
【数据库之mysql】 mysql 入门教程(二)
查看>>
【HTML5/CSS/JS】A list of Font Awesome icons and their CSS content values(一)
查看>>
【HTML5/CSS/JS】<br>与<p>标签区别(二)
查看>>
【HTML5/CSS/JS】开发跨平台应用工具的选择(三)
查看>>
【心灵鸡汤】Give it five minutes不要让一个好主意随风而去
查看>>
【React Native】Invariant Violation: Application AwesomeProject has not been registered
查看>>
【ReactNative】真机上无法调试 could not connect to development server
查看>>
【XCode 4.6】常用快捷键 特别是格式化代码ctrl+i
查看>>
【iOS游戏开发】icon那点事 之 实际应用(二)
查看>>