Search code examples
phpmagentocachingmagento-1.9

Magento CMS block on footer not working after cache enable


I'm trying to show a Magento CMS block only one home page footer area, I'm using below code

$routeName = Mage::app()->getRequest()->getRouteName(); 
$identifier = Mage::getSingleton('cms/page')->getIdentifier();

if($routeName == 'cms' && $identifier == 'home') {
echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_seo')->toHtml();
} 

This code working perfectly when i disable cache, but after enable cache this shows on all pages, sometimes not display on any pages.

I tried few solutions on stack-overflow but those didn't worked , my Magento version is 1.9.2.4

Anyone know how to fix this issue please


Solution

  • I solved that using action tag inside reference tag for remove cashes from footer,

    This looks like a known bug on Magento 1.9 versions, Thanks for everyone helps me specially Mladen Ilić

    <reference name="footer">
        <action method="setCacheLifetime"></action>
            <block type="cms/block" name="footer.seo">
                <action method="setBlockId"><value>footer_seo</value></action>
            </block>
        </reference>