Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

languages and getIsHomePage()
 
borje
Member
 
Total Posts:  40
Joined:  2010-10-21
 

If i’m on the front page and change language and use $this->getIsHomePage() in a template, it returns false. Is this supposed to be expected behaviour? Is there a way around it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
borje
Member
 
Total Posts:  40
Joined:  2010-10-21
 

Haven’t recieved an answer if this is the expected behaviour or not, but I made the following to get around it:

<?php if ($this->getIsHomePage() || ($this->getRequest()->getModuleName() == 'cms' && $this->getRequest()->getControllerName() == 'index' && $this->getRequest()->getActionName() == 'defaultIndex')):?>
<?php 
echo $this->getChildHtml('whatever'); ?>
<?php 
endif; ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Mishmashash
Jr. Member
 
Total Posts:  3
Joined:  2012-03-15
 

Know it’s a bit late but have been getting this problem too, your solution didn’t do it for me, but the third part of this one did:
http://learntipsandtricks.com/blog/magento/187/Magento-How-to-find-if-you-are-on-homepage-getIsHomePage

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top