Forums / Developer / Custom Tool Trouble / Comment44975
Bruce Morrison
Tuesday 13 December 2005 3:03:28 am
Hi Fraser
I think this is an with the cache. When you first view he page after the cache has been cleared $node is set. On the second viewing the cached version of the page is used. In the cached version $node is not retrieved (and not set) - this is the purpose of the cache, to save unnecessary database access. Of course this doesn't help you much ;)
If you are viewing a page with a node (pages like search results or the shop do not have a node_id) you will have to retrieve it first.
{* Toolbar - Related *} {if is_set($module_result.content_info)} {def $current_node = fetch(content,node,hash(node_id,$module_result.content_info.node_id))} {if is_set($current_node.object.data_map.keywords.content)} <div class="toolbar-item {$placement}"> {def $related_nodes=$current_node.object.data_map.keywords.content.related_nodes} <div class="toollist"> <div class="toollist-design"> <h2>{$title}</h2> <div class="content-view-children"> {foreach $related_nodes as $related_node} <p>{node_view_gui view=listitem content_node=$related_node}</p> {/foreach} </div> </div> </div> </div> {undef $current_node} {/if} {undef $related_nodes} {/if}
CheersBruce
My Blog: http://www.stuffandcontent.com/ Follow me on twitter: http://twitter.com/brucemorrison Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish