Another v. 3.2-2 related issue

Author Message

Eirik Alfstad Johansen

Tuesday 21 October 2003 5:59:14 am

Hi again,

I'm experiencing yet another mysterious problem after having upgraded to 3.2-2. In my pagelayout.tpl, I have the following template code which is supposed to display a specific code block if the user is viewing the main page (node #2).

{switch name=Sw1 match=$node.node_id}
{case match=2}
{* SOME CODE *}
{/case}
{/switch}

The problem is that the code isn't displayed when the node id equals 2. Well, it is, but only once and that's after I've cleared the content cache. Then, if I reload the page, the code block disappears again.

Does this make any sense to anyone?

Sincerely,

Eirik Johansen
Netmaking AS

http://www.netmaking.no/

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Hans Melis

Tuesday 21 October 2003 2:23:18 pm

AFAIK, $node is not available in pagelayout templates when you're using viewcaching.

What I use in pagelayout templates (and it works with caching) is $module_result.node_id

If you do {$module_result|attribute(show)}, you'll find even more interesting variables. And if you really need the node itself, instead of just the ID, you can always do a fetch('content','node', hash(node_id, $module_result.node_id))

hth

--
Hans

Hans
http://blog.hansmelis.be

Eirik Alfstad Johansen

Wednesday 22 October 2003 12:41:01 am

Hi Hans,

Thanks a lot for the tip. I don't know why it worked using $node_id in the previous version, but the $module_result was eactly what I needed to get it working in in 3.2-2.

Thanks again !

Sincerely,

Eirik Johansen
Netmaking AS

http://www.netmaking.no/

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

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 18 2025 19:32:31
Script start
Timing: Jan 18 2025 19:32:31
Module start 'layout'
Timing: Jan 18 2025 19:32:31
Module start 'content'
Timing: Jan 18 2025 19:32:32
Module end 'content'
Timing: Jan 18 2025 19:32:32
Script end

Main resources:

Total runtime1.0203 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.0313152.6250
Module start 'layout' 0.00510.0022 741.656339.4453
Module start 'content' 0.00731.0113 781.1016542.4688
Module end 'content' 1.01860.0016 1,323.570312.1641
Script end 1.0202  1,335.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3144160.0002
Check MTime0.00130.1265160.0001
Mysql Total
Database connection0.00070.066610.0007
Mysqli_queries0.966794.7501570.0170
Looping result0.00050.0518550.0000
Template Total0.992897.320.4964
Template load0.00250.241220.0012
Template processing0.990497.068420.4952
Template load and register function0.00010.009810.0001
states
state_id_array0.00080.080610.0008
state_identifier_array0.00160.153320.0008
Override
Cache load0.00190.1874340.0001
Sytem overhead
Fetch class attribute can translate value0.00050.053820.0003
Fetch class attribute name0.00100.100650.0002
XML
Image XML parsing0.00090.087220.0004
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00090.0917210.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs