I'm facing this problem even before CE 1.9.2
- In footer, I create a global custom block with
page/html_wrapper
type like below
<default>
<reference name="footer">
<block type="page/html_wrapper" name="bottom.wrapper" as="bottomWrapper">
...
...
...
- In some specific pages, such as Shopping Cart, Checkout Onepage,... I don't want to show this custom block, then I remove it by
<checkout_cart_index translate="label">
<remove name="bottom.wrapper"/>
...
...
or by
<checkout_cart_index translate="label">
<reference name="footer">
<remove name="bottom.wrapper"/>
...
...
...
or by
<checkout_cart_index translate="label">
<reference name="footer">
<action method="unsetChild"><name>bottomWrapper</name></action>
...
...
...
- Prolem is, if the first visit page that generates the cache is a global page (such as home page),
footer
will be cached, includedbottom.wrapper
block, then all the above specific pages showbottom.wrapper
as well. If the first visit page that generates the cache is one of above specific pages,footer
will be cached withoutbottom.wrapper
block, then all other pages won't seebottom.wrapper
anymore.
Disabling BLOCK_HTML
cache is a temporary solution. I don't want to hide bottom.wrapper
block by css.
How to deal with it? How to make bottom.wrapper
showing properly as desire?
UPDATE:
Because this question has marked duplicate, so I cannot give an answer for my own solution:
My bottom.wrapper
is placed in bottom of the pages, doesn't mean it must be included in footer.
Instead of including in the footer, I create a new child block of the root
<default>
<reference name="root">
<block type="page/html_wrapper" name="bottom.wrapper" as="bottomWrapper">
...
...
...
Then in the page template, such as 1column.phtml
, 2columns-left.phtml
,... I insert before footer
:
<?php echo $this->getChildHtml('bottomWrapper') ?>
By now, bottomWraper
is cached by its own key, not attached to the footer
anymore.
Other step (removing, getting,..) is just like before.