Check home page URL in magento
April 18, 2011 | In: Magento
Check current page is home page in magento
If you want to check current page is home page or not in magneto below code is helpful to you.
<?php
if(
Mage::getSingleton('cms/page')->getIdentifier() == 'home' &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms'
) :
?>
The other way you can check current page is home page or not in magento
<?php
if($this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true))):
echo "Homepage";
else:
echo "Not in Homepage";
endif;
?>
Justwebdevelopment can also help you in...
Magento Development | PSD To Magento | Magento Theme Development | Magento Extension Development
Magento Development | PSD To Magento | Magento Theme Development | Magento Extension Development




4 Responses to How to get Current page url in magento.
Micky
November 13th, 2011 at 6:29 am
May be this is also helpful to people
how to call phtml in magento :
$this->getLayout()->createBlock(‘catalog/product_list’)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
Devid
December 12th, 2011 at 6:27 pm
Please look at this url
this help to make dynamic module
http://www.silksoftware.com/magento-module-creator/
Devid
January 18th, 2012 at 9:33 am
check it may this is help ful
http://www.nicksays.co.uk/magento_events_cheat_sheet/
Web Form Generator
April 26th, 2013 at 9:29 am
Nice post. I was checking continuously this weblog and I am inspired! Extremely helpful information specifically the final part
I handle such info a lot. I used to be looking for this certain information for a long time. Thank you and good luck.