Get Magento URL and Path

Magento
When you work or develop magento site so many places you need to some magento URL. Magento URL and magento path is very helpful to make development easy. When you want to create magento static block and you want to show some image or set any page link then you need to set exact path for that. Maegnto provide some basic path or URL by default. Here I want to show you magento path and URL. Use magento URL in static block get SKIN URL [php]{{skin url='images/sampleimage1.png'}}[/php] get Media URL [php]{{media url='/sampleimage1.png'}}[/php] get Store URL [php]{{store url='contact.html'}}[/php] get Base URL [php]{{base url='yourstore/contact.html'}}[/php] Use magento URL path in PHTML get Homepage URL [php]<?php $home_url = Mage::helper('core/url')->getHomeUrl(); ?>[/php] Or check current page is homepage [php]<?php if( Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() ==…
Read More