magento check for home page

magento-logo

Here is the tip for you to check for homepage in Magento. I had come across a situation to add a banner block conditionally on the homepage. The below code helps me to accomplish the same. Hope this will help you too.

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