Magento – Check If Current Page is Home page

Sunday, 27. November 2011

If you have been wondering how easy it is to check if current page is a home page or not in Magento, this script may help out.

<?php if(Mage::getSingleton('cms/page')->getIdentifier() == 'home'  && 
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms') : ? >
# DO The Homepage stuff
<?php endif;?>

Feel free to drop an alternative idea if you have one!

Tags: , , .

Leave a Reply

You must be logged in to post a comment.