Here is the code to get base url, media url, store url, javascript url, images path etc in Magento.
To retrieve URL path in Static Block -
To get Skin URL
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:
To retrieve URL path in Static Block -
To get Skin URL
{{skin url='images/anx.jpg '}}To get Media URL
{{media url='/anx.jpg'}}To get Store URL
{{store url='anx.html'}}To get Base URL
{{base url='storename/anx.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:
<?php echo getSkinUrl('images/anx.jpg') ?>Secure Skin URL
<?php echo getSkinUrl('images/ anx.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);
Nice Article....Ankur
ReplyDeleteThis comment has been removed by the author.
ReplyDeletemagento 2 download is a a must-have for any online store
ReplyDeleteHi! I have 1.5 years experience. I search in Google so Many Websites & Blog but you’re blog and post really is too good its title, description, images your content style is really good and I feel glad when post read Magento Content Management System
ReplyDeleteGreat Read! I am impressed on how you make your article easy to understand. I'll come back for more :D
ReplyDeleteJaps Buidon is a Social Media Specialist and belongs to a team of Magento Developer in Florida. For more tutorial and tips you can follow him here -> alwaysopencommerce.com
E-commerce website will automatically sell your products, notify you of new sales, process the payments, track inventory and communicate with your customers and thus improves your business. Magento Development Companies in Bangalore
ReplyDelete