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条)

报告相同问题?