Dissapearing Menu

Author Message

Richard Tuin

Tuesday 04 July 2006 3:34:15 am

While developing and filling a website i'm working on, there appears to be some strange cache behaviour.

The menu of the website is on the left (the template is a slightly modification of the standard left_menu.tpl).
It renders well all the time, except when something has changed in the subtreenode of the node you're viewing.
Then the menu doesn't show up at all.

I tried various solutions like creating a cache block with the key on $node.node_id, and not using cache blocks.

Somewhere else on the forum i read that $node is not usable in a cached pagelayout.tpl.

Is anyone familiar with this problem, or can think of any solutions?

Any think along is also greatly appreciated.

Nathan Kelly

Wednesday 05 July 2006 12:24:54 am

Hi Richard,

I had a similar problem with this today, I was using $node.whatever in an override pagelayout i.e. home_pagelayout.tpl

I was trying to out put the description from the main node on the home page with:

{$node.object.data_map.description.content.output.output_text}

This worked fine untill the page was cached.

I changed my home_pagelayout.tpl to instead include:

{include uri="design:page_mainarea.tpl"}

Then I created an override template for page_mainarea.tpl, my override template now contains my $node.whatever and everything works fine now.

[home_mainarea]
Source=node/view/full.tpl
MatchFile=full/home_page.tpl
Subdir=templates
Match[node]=2

So I'd suggest you don't use the $node variable in the pagelayout if you want to use the cache.

I hope this solves your problem.

Cheers!

Pardon me while I burst into flames...

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.