Monday 13 November 2006 12:59:36 am
Hi, You could try something like this:
{def $second_level_children=array()} {def $root_node_children=fetch('content', 'list', hash('parent_node_id', 2))}
{if gt($root_node_children|count,0)}
<ul>
{foreach $root_node_children as $child}
<li>
<a href={$child.url_alias|ezurl()}>{$child.name|wash()}</a>
{if or(eq($child.node_id,$module_result.node_id),eq($module_result.path.1,$child.node_id))}
{set $second_level_children=fetch('content','list',hash('parent_node_id', $child.node_id))}
{if gt($second_level_children|count,0)}
<ul>
{foreach $second_level_children as $child2}
<li><a href={$child2.url_alias|ezurl()}>{$child2.name|wash()}</a></li>
{/foreach}
</ul>
{/if}
{/if}
<li>
{/foreach}
</ul> {/if} First fetch the elements of the top level, foreach element check if it's the node that is being viewed or if it's one of its children's node. If so, show its children. The code above has not been tested, but maybe would give you an idea on how to do it.
Microblau SL
http://www.microblau.net
|