Using the code below to check current page is home page or not.
<?php if(
Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms'
) : ?>
//insert your code here
<?php endif; ?>
Revisions
- February 25, 2014 @ 14:28:32 [Current Revision] by admin
- February 25, 2014 @ 14:29:35 [Autosave] by admin
- February 25, 2014 @ 14:28:32 by admin
- February 25, 2014 @ 14:26:19 by admin
- February 25, 2014 @ 14:19:49 by admin
Revision Differences
February 25, 2014 @ 14:26:19 | Current Revision | ||
---|---|---|---|
Content | |||
Unchanged: <pre> | Unchanged: <pre> | ||
Deleted: <code style="border: 0px;font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace;margin: 0px;padding: 0px;vertical-align: baseline;line-height: normal"> | Added: <code style="border: 0px;font-family: Monaco, Consolas, 'Andale Mono', 'DejaVu Sans Mono', monospace;margin: 0px;padding: 0px;vertical-align: baseline;line-height: normal">Using the code below to check current page is home page or not. | ||
Added: <?php if( | |||
Unchanged: Mage::getSingleton( 'cms/page' )->getIdentifier() == 'home' && | Unchanged: Mage::getSingleton( 'cms/page' )->getIdentifier() == 'home' && | ||
Unchanged: Mage::app()-> getFrontController()-> getRequest()- >getRouteName() == 'cms' | Unchanged: Mage::app()-> getFrontController()-> getRequest()- >getRouteName() == 'cms' | ||
Deleted: ) : ? | Added: ) : ?> | ||
Unchanged: //insert your code here | Unchanged: //insert your code here | ||
Deleted: < | Added: <?php endif; ?></code></pre> |
Note: Spaces may be added to comparison text to allow better line wrapping.
No comments yet.