3

On the homepage of our site, we have 3 banners which are contained in a static block inside the CMS page of my homepage.

The static block also contains a widget, the widget select random banners every time.

When i turn on FPC the banners are always the same, while i want that content to change.

So now i am wondering how to punch a hole for that section of the page. It is a seperate phtml file if that makes things easier.

I have been reading about placeholders, which i may be able to implement but the "block" section in these refer to a model/action which i don't have...

If anyone has any ideas or suggestions, i am stuck and have no idea where to move from here.

Some Magento documentation says, i should be able to punch a hole (only) in Category view pages, Product view pages, CMS pages but doesn't explain how...

here's my static block which i want to exclude from FPC:

<div class="three-up">
<ul>
    <li>
        <div class="promo">{{widget type="enterprise_banner/widget_banner" display_mode="fixed" rotate="shuffle" banner_ids="5,6,7" template="banner/widget/block.phtml" unique_id="5dc648821230ac32e92657639db02dbe"}}<h2><a href="{{store url=''}}jam-collection.html?k1" >Shop Jam &raquo;</a></h2></div></li>
    <li>
        <div class="promo">{{widget type="enterprise_banner/widget_banner" display_mode="fixed" banner_ids="3" template="banner/widget/block.phtml" unique_id="9e62c67346ce7fc53bac7f15b927f916"}}<h2><a href="{{store url=''}}-collection.html?k2" >Shop &raquo;</a></h2></div></li>
    <li>
        <div class="promo">{{widget type="enterprise_banner/widget_banner" display_mode="fixed" banner_ids="4" template="banner/widget/block.phtml" unique_id="2aa38aac002658c09283c8ad02626eaf"}}<h2><a href="{{store url=''}}-collection.html?k2" >Shop &raquo;</a></h2></div>
     </li>
</ul>

3

Challenge

Your biggest hurdle here is that your static block does not hole punch by default, but widgets will hole-punch automatically. So your goal should be to output all 3 widget rotators without the use of a static block.

So, then, my suggestion is that you get rid of the static block approach and instead create block reference areas to target with your widget. Classy Llama has a list of default regions available on their blog, referenced here:

Breadcrumbs

Left Column

Main Content Area

My Cart Extra Actions

Navigation Bar

Page Bottom

Page Footer

Page Header

Page Top

Right Column

Store Language

How to do it:

Creating a block reference is easy:

Define the block in layout XML:

<default>
    <reference name="content">
        <block type="core/text_list" name="some_block_name" as="some.block.name" translate="label">
            <label>Widget Rotator Target Region</label>
        </block>
    </reference>
</default>

And then you'll need to echo it from your template to force it and all dynamically inserted widget blocks to render:

#file: 1column.html
<?php echo $this->getChildHtml('some_block_name'); ?>

Then, it should show up in your widget list:

enter image description here

This should output in your template now when FPC is enabled wrapped in hole punch comments.

Cheers!


Image and bullet content sourced from:

http://www.classyllama.com/blog/widgets-magento-enteprise

  • thanks for the response, i'm going to try your solution and let you know what happens. Thanks again!!! – Tobias Hagenbeek Mar 6 '14 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.