Hello
Here is how I usually do it when I have the same issue.
I change the cache key for the footer to make 2 different cache files, depending on the page.
Fist of all add a new property to the footer for the page that is different.
In your case make the layout for the footer like this:
<cms_index_index>
<reference name="footer">
<action method="setTemplate"><template>mymodule/mymodule-footerblock/mymodule-footerblock-home.phtml</template></action>
<action method="setHomepageFooter"><value>1</value></action><!-- the way you name your method is not important -->
</reference>
</cms_index_index>
now override the Mage_Page_Block_Html_Footer in order to change the cache key. To override the block follow this tutorial: http://magedev.com/2009/06/03/magento-overriding-model-block-or-helper/
In your new class that overrides the footer block add this method.
public function getCacheKeyInfo(){
$info = parent::getCacheKeyInfo();
$info[] = (int)$this->getHomepageFooter();//same method as in the layout file but use get instead of set.
return $info;
}
This is really helpful if you want to have other pages with different footer.
Just add a line in the layout file for the page you want a different footer
<action method="setCustomMethodName"><value>1</value></action>
and in the getCacheKeyInfo method add a new line:
$info[] = (int)$this->getCustomMethodName();
It works perfectly for me.
Cheers,
Marius.
如果您懒的写,懒的看,那么下载我写的插件吧,下载地址为:
http://download.csdn.net/detail/terry_water/7097161