How to Get media url, js url, store url and home url in Magento?

To Get Media Url Syntax:-
$mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);


$mediaUrl = Mage::getBaseUrl('media');

To Get Js Url Syntax:-
$jsUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

To Get Store Url Syntax:-
$storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

To Get Home Url Syntax:-
$homeUrl= Mage::helper('core/url')->getHomeUrl();

To CMS Pages Or Static Blocks For  Media:-
{{media url='/imagename.jpg'}}

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *