Forums / Setup & design / $node / $module_result / $DesignKeys question
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
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.