These are the following methods to get Magento Base Url, Magento Skin Url, Magento Media Url, Magento Js Url.to get all write the following code
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); or you can write $this->getUrl();
e.g:- http://yoursite.com/index.php/
Get Magento Media Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
e.g:- http://yoursite.com/media/
Get Magento Skin Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); or you can write $this->getSkinUrl();
e.g:- http://yoursite.com/skin/
Get Magento Store Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
e.g:- http://yoursite.com/
Get Magento Js Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
http://www.yoursite.com/js
Magento Tutorial, Magneto modules, Magento Banckend, Magento admin, Magento Frontend, Magento Interview Question, Jquery, CSS, Javascript, PHP, XHTML
11/04/2010
get skin url, get js url, get media url, get store url ,get base url in magneto
Labels:
Magento
Subscribe to:
Post Comments (Atom)
in which file add this code? plz specify path
ReplyDeleteGreat post thanks for sharing such informative post.
ReplyDeleteHi Anjan, just to say thank you, your articles have helped me a lot and have learned well. Once again thanks for your contributions.
ReplyDeletephp-aplicado.blogspot.com
contributing a bit for this article:
ReplyDeleteFor get the skin frontend package and theme in a static way, use:
Mage::getDesign()->getSkinUrl('images/');
Mage::getDesign()->getSkinUrl('css/');
Mage::getDesign()->getSkinUrl('js/');
It's produce:
http://localhost.com/skin/frontend/(package)/(theme)/images/
http://localhost.com/skin/frontend/(package)/(theme)/css/
http://localhost.com/skin/frontend/(package)/(theme)/js/
Regars
Thanks its really very helpful.
ReplyDeleteThanks..... it's really useful information
ReplyDelete