3
votes

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>
1
Can you test the result with echo $this->getChildHtml('footer') or echo $this->getChildHtml('before_body_end') commented out, to see which one of those calls is displaying the double content ? - blmage
@blmage this one: echo $this->getChildHtml('footer') - StasGrin
footer block - is just text with copyrights and nothing more. just 2 lines of HTML. footer_block - is menu, that is doubled. - StasGrin
In the source of your website, the additional content is placed outside <div class="wrapper"></div>, so there must be something that is not working well between the definition and/or uses of the footer block and the layout cache, can you paste here the places where the footer block is referenced in your layout files ? - blmage
@blmage here they are. just default base theme files with some modifications: 1. catalog.xml: pastebin.com/SpwrTvcm 2. page.xml: pastebin.com/Nq09Pckp - StasGrin

1 Answers

2
votes

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.