0

Just starting to setup a new project, and using ExpressionEngine v2.8.x with its new Template Layouts functions. Problem is that if I have the CE Cache tags in the setup, and have set to dummy while I'm developing, it will break the Template {layout} tags.

Here's the template code with CE Cache that breaks:

{layout="_layouts/base" title="The Title"}

{exp:ce_cache:it id="page-home" tag="home" seconds="14400"}

{exp:channel:entries channel="site_content" limit="1"}

    <h1>{title}</h1>

    {cf_content_body}

    {layout:set name="page_title"}
        {title}
    {/layout:set}
    {layout:set name="page_description"}
        {cf_content_summary}
    {/layout:set}

{/exp:channel:entries}

{/exp:ce_cache:it}

And here's the same code without CE Cache that does work: {layout="_layouts/base" title="The Title"}

{exp:channel:entries channel="site_content" limit="1"}

    <h1>{title}</h1>

    {cf_content_body}

    {layout:set name="page_title"}
        {title}
    {/layout:set}
    {layout:set name="page_description"}
        {cf_content_summary}
    {/layout:set}

{/exp:channel:entries}

If anyone has any kind of solution, I'm up for it or at the least some acknowledgement that it's a known problem and it's being worked on in the devotee thread that starting back in March 2014 (http://devot-ee.com/add-ons/support/ce-cache/viewthread/12978).

Thanks Brendan

2 Answers 2

1

I've run into this before as well. The issue is that the layout:set action doesnt occur when the cached content is retrieved, so the parent layout has no way to know what it's contents should be. Have you tried escaping the layout:set part from the cacheing? That may or may not work. Worst case, and the route that I ended up taking is to just use native tag cacheing when layout was being set. It's not ideal, but latest EE at least gives us a Redis driver for the native cache.

1

This has also been asked on the official support forum here: https://devot-ee.com/add-ons/support/ce-cache/viewthread/14051.

This comment: https://devot-ee.com/add-ons/support/ce-cache/viewthread/14051#49482 also provides a way of caching the layouts although I'm pretty sure it won't address your layout:set issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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