Magento Resources: Shortcodes, File Paths, and Theme Paths

This list will keep updating, if I miss something, please leave a comment.. Thank you!

SKIN URL

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

Media URL

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

Store URL

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

Base URL

{{base url='website/mypage.html'}}

Get Template URL

When you edit your .html files, you may need this short codes
Unsecure Skin URL:

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

Secure Skin URL

getSkinUrl('images/image1.gif', array('_secure'=>true)) ?>

Current URL

Mage::helper('core/url')->getCurrentUrl()

Get Home URL

Mage::helper('core/url')->getHomeUrl()

Link Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)

Media Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)

Skin Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)

Store Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)

Js Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS)

Store ID and Codes and Website ID and Codes

Get Store ID

(Mage::app()->getStore()->getId()

Get Store Code

(Mage::app()->getStore()->getCode()

Get Website ID

(Mage::app()->getWebsite()->getId()

Get Website Code

(Mage::app()->getWebsite()->getCode()
Please click to rate!
About

Elvin is one of the contributors of InnoveDesigns.com. He has been creating Wordpress Plugins, Magento Extensions, & Mobile Applications. If you find this article useful, please Follow him on .

Published under Magento, Web Development Guide