Forums / Setup & design / Unexpected Output- weird caching problems? Not sure...

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

Author Message

arthur foelsche

Saturday 17 May 2003 12:24:00 pm

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,"") }
{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 :( I've tried removing the cache-blocks and that doesn't change the output.

anybody have anythoughts?

Matthew Knell

Friday 25 July 2003 7:43:43 am

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 =|