How do I add block that is working only for home page in magento?
I want to display slider in homepage only not for the rest of the cms pages.My banner script is in the header.phtml file.
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
You can try my code.It’s working for me.
<?php
// IF WE ARE ON HOMEPAGE
if(Mage::getSingleton(‘cms/page’)->getIdentifier() == ‘home’ &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == ‘cms’
) : ?>
// Slider/Banner Code Block
<?php endif; ?>