Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento cache adds content twice

I have Magento CE 1.7.0.2 site with a custom created theme.

Problem is: Only when I turn on cache - some content on page "doubles". So footer showed on page again in the end of the page.

Screen: http://img37.imageshack.us/img37/3038/eqv7.jpg
(Shop By block and footer doubled, as you see in the bottom)

Any suggestions how to fix? Or where to start looking at?

Thanks for any help,
Stanislav.

P.S. Code of "1-column.phtml" (this page template PHTML)

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php echo $this->getChildHtml('head') ?>
</head>
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper">
    <?php echo $this->getChildHtml('global_notices') ?>
    <?php echo $this->getChildHtml('header') ?>
    <div class="category-page">
        <?php echo $this->getChildHtml('breadcrumbs') ?>
        <div class="bread" style="margin-top:40px"></div>
        <?php echo $this->getChildHtml('global_messages') ?>
        <div class="product-page" style="min-height:auto;">
            <div class="content_main">
                <?php echo $this->getChildHtml('content') ?>
            </div>
        </div>
    </div>
    <div class="bread2"></div>
    <?php echo $this->getChildHtml('footer_block') ?>
</div>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</body>
</html>
like image 941
StasGrin Avatar asked Nov 26 '25 05:11

StasGrin


1 Answers

In your layout, you have two footer blocks, which use the same page/html_footer type. Or, this block type is not intended to be used more than one time on the same page, the first content it will display will be cached and returned on the later calls (see Mage_Page_Block_Html_Footer::getCacheKeyInfo()). So, for one of your footer blocks, you should use another block type (this should be footer_block, as it's the one not existing in base Magento).

On a side note, your footer_block block is defined two times, once in page.xml and once in catalog.xml, and both of your footer blocks contain a child named bottom.container, so you could try to remove it from the definition of footer_block.

like image 101
blmage Avatar answered Nov 27 '25 19:11

blmage



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!