2013-02-25 00:33
浏览 72

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

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


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


^^ 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.

图片转代码服务由CSDN问答提供 功能建议

启用缓存后,我遇到了Magento的这个问题...... < p> 问题:


   $ this-&gt; getLayout() - &gt; getBlock('head') - &gt; getTitle(); 

^^我用过这个和其他方法 在页脚中获取当前URL并遇到相同的症状。 通过缓存,它可以获得当前页面没有问题但是通过缓存可以得到例如商店的页面标题,然后访问其他页面显示它仍然是商店。


  1. 访问主页( http://devtest.eboost.com/ )。

  2. 导航到博客并滚动到底部,这样你就可以了 可以看到页脚。 粉末,镜头和公司的一些超链接在主页和所有其他页面上应该是不同的。 缓存时它表现得很好。 这些链接在header.phtml中工作得很好并且具有相同的逻辑。

    启用缓存时,它在行为时不会出现这种情况 header.phtml文件所以我很困惑。 我是否需要做一些特殊的事情,或者以某种方式从缓存监控中取出footer.phtml? 我不认为从缓存监控中删除它是明智的,因为我们在本文档中有大部分JavaScript。

    我不知道该怎么做,并且非常有压力去解决这个问题 使我们客户的网站生效。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

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/

    解决 无用
    打赏 举报

相关推荐 更多相似问题