I have tried the following two methods in catalog/navigation/vert_nav.phtml to add or suppress content specific to the home page:
if($this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true))):
or
if(
Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms'
) :
Both work fine, however when BLOCK_HTML cache is turned on, it works at first, then after a while the home page starts displaying content that is intended only for other pages (after an else clause I use lower down). When I turn off the BLOCK_HTML, it behaves as expected.
Interestingly I've used the same code (the 1st one) in page/html/head.phtml (for home page specific javascript/css), and in page/html/header.phtml (for a header banner that should only appear on the home page), and these work fine even when BLOCK_HTML is ON.
(Magento 1.4.1.1)
Mage::getSingleton('cms/page')->getIdentifier() == 'home' ? '1', '0'
- should beMage::getSingleton('cms/page')->getIdentifier() == 'home' ? '1': '0'
to work correctly – Kenric