magento if home


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php if(Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' && Mage::getSingleton('cms/page')->getIdentifier() == 'home') : ?>
  2. <h1>This is the home page!</h2>
  3. <?php else : ?>
  4. <h2>This is NOT the home page! :(</h2>
  5. <?php endif; ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.