Wednesday, May 02, 2012

Urls of Magento for you only :)

If you need the source url of an image, javascript or file, call one of this
functions adding your own path at the end.
Below is the list of all the functions alongwith exapmles:

PATH TO ROOT DIRECTORY:
http://admintest.com/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>

PATH TO JS DIRECTORY:
http://admintest.com/js/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>

PATH TO ROOT INDEX:
http://admintest.com/index.php/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>

PATH TO MEDIA DIRECTORY:
http://admintest.com/media/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>

PATH TO SKIN DIRECTORY:
http://admintest.com/skin/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>

PATH TO CURRENTDIRECTORY:
http://admintest.com/skin/frontend/default/default
<?php echo $this->getSkinUrl('') ?>



 

No comments: