Home    Articles


How to identify if you are on the homepage in magento


You may need to display a custom code or something specific for the hompage, and you need to identify the homepage…
In order to know if you are on the magento’s homepage use tis code:

$isHome = (Mage::getSingleton('cms/page')->getIdentifier() == 'home') ? true :false;
    echo 'I am on homepage.';
    echo 'This is not the homepage.';

That’s all.