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

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

eZ debug

Timing: Jan 30 2025 21:26:54
Script start
Timing: Jan 30 2025 21:26:54
Module start 'layout'
Timing: Jan 30 2025 21:26:54
Module start 'content'
Timing: Jan 30 2025 21:26:54
Module end 'content'
Timing: Jan 30 2025 21:26:54
Script end

Main resources:

Total runtime0.0236 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.2813151.2266
Module start 'layout' 0.00570.0037 739.5078220.7188
Module start 'content' 0.00930.0130 960.2266997.7266
Module end 'content' 0.02230.0013 1,957.953129.9922
Script end 0.0236  1,987.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002912.2346140.0002
Check MTime0.00114.6948140.0001
Mysql Total
Database connection0.00062.558710.0006
Mysqli_queries0.00218.977030.0007
Looping result0.00000.139210.0000
Template Total0.00094.010.0009
Template load0.00073.150710.0007
Template processing0.00020.786710.0002
Override
Cache load0.00052.140110.0005
General
dbfile0.00208.437580.0002
String conversion0.00000.033340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs