$node / $module_result / $DesignKeys question

Author Message

Vivienne van Velzen

Thursday 25 September 2003 1:42:55 am

Hi,

I've searched through the site to find caching-related articles, seeing as I've succeeded in creating a really slow website.
Some of the documentation is contradictory, however.
I've read that it doesn't matter if you use $node in templates while using caching (<quote>Don't worry about view caching or not: when cached, the template isn't used anyway</quote> ). This was said in:
http://www.ez.no/developer/ez_publish_3/documentation/customization/custom_design/template_variables_set_by_ezpublish

Everywhere else tells me to use $module_result when using caching.
But I'm working with a development server (caching off) and a production server (caching on). So I need a solution that will work with caching on or off.
Is this possible by using the $DesignKey variable to get the node_id and then do a fetch? Or would this slow my site down even more?
I really could use any advice here. TIA,

Vivienne

Paul Borgermans

Thursday 25 September 2003 6:04:23 am

Hi Vivienne,

You van use $node in view templates for nodes:

like /node/view/[full|line|...].tpl or in your overrides for this.

When you use $node here, it will work regardless of caching: when it is cached, it won't call the template at all.

It is *not* valid in pagelayout templates. Here you have to use $module_result... from which you can grab the nodeid and do a fetch for the node if you need that. This is also always valid (as far as I tested it)

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Vivienne van Velzen

Thursday 25 September 2003 11:36:07 pm

Thanks Paul,

This certainly helped clear things up for me. Now I can bring some structure into my pages, as I was using $node and $module_result willynilly throughout the site.

Vivienne

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 19 2025 00:36:21
Script start
Timing: Jan 19 2025 00:36:21
Module start 'layout'
Timing: Jan 19 2025 00:36:21
Module start 'content'
Timing: Jan 19 2025 00:36:22
Module end 'content'
Timing: Jan 19 2025 00:36:22
Script end

Main resources:

Total runtime0.8353 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.0110 588.0313152.6406
Module start 'layout' 0.01100.0027 740.671939.4766
Module start 'content' 0.01370.8203 780.1484535.3438
Module end 'content' 0.83390.0014 1,315.492212.1250
Script end 0.8353  1,327.6172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4193160.0002
Check MTime0.00160.1870160.0001
Mysql Total
Database connection0.00110.135410.0011
Mysqli_queries0.784193.8621570.0138
Looping result0.00050.0636550.0000
Template Total0.788694.420.3943
Template load0.00220.265820.0011
Template processing0.786494.136620.3932
Template load and register function0.00020.019310.0002
states
state_id_array0.00680.811110.0068
state_identifier_array0.00170.199920.0008
Override
Cache load0.00190.2220260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.078020.0003
Fetch class attribute name0.00080.100440.0002
XML
Image XML parsing0.00080.097920.0004
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00080.0952170.0000
String conversion0.00000.000940.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs