This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Unexpected Output- weird caching...
expandshrink

Unexpected Output- weird caching problems? Not sure...

Unexpected Output- weird caching problems? Not sure...

Saturday 17 May 2003 9:24:00 pm - 1 reply

Hi-

I've been working on developing a news site. I have a class defined which is pagetitle, which allows me to set a specific page title for an article which is different than the article title itself. Sometimes I don't have a pagetitle assigned (or I'm viewing a category instead of a specific article) and in this case, I want to display the node title. The code I'm using works on the FIRST page load, but after this, the variables don't seem to contain data. Subsequent page loads don't work at all here's my code, the output from the first page load, and then the data from the second page load:

{* Set $pagetitle to page or the node title depending on whether the page has a specific title *}
{let thispagetitle="this is a test"}
{let displaylatestnews="false"}
{section show=ne($node.object.data_map.pagetitle.content,""blunk.gif Emoticon }
{cache-block keys=array('thispagetitle', $DesignKeys:used.node)}
{set thispagetitle=$node.object.data_map.pagetitle.content}
{/cache-block}
{set displaylatestnews="true"}
{section-else}
{cache-block keys=array('thispagetitle', $DesignKeys:used.node)}
{set thispagetitle=$node.name}
{/cache-block}
{set displaylatestnews="yourmomma"}
{/section}

{* test lots of output *}
{count($pagetitle)},
{count($node.object.data_map.pagetitle.content)},
{count($node.name.content)},
{$node.object.data_map.pagetitle.content},
{$displaylatestnews},
{$thispagetitle},
{$node.contentobject_version_object.data_map.pagetitle.content}

-- first page load:

0, 45,0,Editorial Criticizing Fluoride Action Network,true,Editorial Criticizing Fluoride Action Network,Editorial Criticizing Fluoride Action Network

-- second page load:
0, 0,0,,yourmomma,,

of course, if i turn off caching, it works fine sad.gif Emoticon I've tried removing the cache-blocks and that doesn't change the output.

anybody have anythoughts?

Friday 25 July 2003 4:43:43 pm

Use $module_content in place of node. Do a search through the forums - there's a bunch of threads on it -

Although, my $module_content.parent variable seems not to be working =|

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from