Tuesday 13 December 2005 2:19:24 am
I've created a new tool for the right toolbar to show related items based on a keywords attribute in the node object being viewed. I've also added a condition to show the toolbar only if there is a keywords attribute that is set. With a clear cache, the toolbar shows up when there are set keywords, it displays related items as intended, and clicking on an item takes you to its page. Let's say we clicked on item A in the toolbar and we are looking at item A's page. We can click on item B in the toolbar and go to item B's page. Now, if we click on item A's link in the toolbar again, we go to item A's page but there is no toolbar! The toolbar will never appear on item A's page again until we clear the cache. I suppose that it must have something to do with view caches but i'm not very familiar with how these work. Any suggestions would be much appreciated! Here's the code in the tool template:
{* Toolbar - Related *}
{if is_set($node.object.data_map.keywords.content)}
<div class="toolbar-item {$placement}">
{def $related_nodes=$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>
{/if} {undef $related_nodes} Cheers, Fraser
|