How to tell if your on the home page in magento or not
if
(
$this
->getIsHomePage()) {
echo
'You are in Homepage!'
;
}
else
{
echo
'You are NOT in Homepage!'
;
}
Or you can try this:
$routeName
= Mage::app()->getRequest()->getRouteName();
$identifier
= Mage::getSingleton(
'cms/page'
)->getIdentifier();
if
(
$routeName
==
'cms'
&&
$identifier
==
'home'
) {
echo
'You are in Homepage!'
;
}
else
{
echo
'You are NOT in Homepage!'
;
}