dqhnp44220 2013-02-25 00:33
浏览 72
已采纳

Magento CE 1.7.0.2 - 仅在footer.phtml上启用缓存时才会出现问题

I'm experiencing this problem with Magento when caching is enabled...

Problem:

Using the following in footer I can get the current CMS page title:

$this->getLayout()->getBlock('head')->getTitle();

^^ I have used this and other methods getting current URL in footer and experience same symptoms. With caching off it gets the current page no problem but with caching on it will get for example the page title for the shop then visiting other page shows that it is still shop.

Here is a problem scenario with caching enabled:

  1. Visit homepage (http://devtest.eboost.com/).

  2. Navigate to blog and scroll to the bottom so you can see footer. The hyperlinks for Powders, Shots, and some from Company should be different on homepage and all other pages. It behaves just fine with caching off. The links work fine in header.phtml and has the same logic.

Thing is with caching enabled it doesn't behave like this when in the header.phtml file so I'm confused. Do I need to do something special or maybe somehow take footer.phtml out of cache monitoring? I don't think removing it from cache monitoring would be wise because we have most of our JavaScript in this document.

I'm not sure what to do and very pressured to figure this out to make our client's website live.

  • 写回答

2条回答 默认 最新

  • dongyou6795 2013-02-25 11:37
    关注

    Update: @benmarks 's Answer is miles better. Use that.

    Try removing the footer from the cache. Try this - http://ken.edmonds-commerce.co.uk/magento/disable-footer-block-caching-in-magento/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 echarts动画效果失效的问题。官网下载的例子。
  • ¥60 许可证msc licensing软件报错显示已有相同版本软件,但是下一步显示无法读取日志目录。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加