Check home page URL in magento

April 18, 2011 | In: Magento

Check current page is home page in magento

If you want to check current page is home page or not in magneto below code is helpful to you.

Mage::getSingleton('cms/page')->getIdentifier() == 'home'  &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' 
) : 

The other way you can check current page is home page or not in magento

if($this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true))):
	echo "Homepage";
	echo "Not in Homepage";

Related Posts

Leave a Reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Inquire Now



PSD to Magento Advertisement Advertisement Advertisement

Latest comments

  • None found