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.
Your code works great! Thanks a lot Bruce! I appreciate your help.
I'm still a litte confused as to why the node isn't available in the tool template. When i use my old code in the node/view/full template it works fine.
Fetching the node in the tool template did seem to slow things down a bit.
Cheers,
Fraser
You must be logged in to post messages in this topic!