Monday 18 December 2006 3:23:16 am
Hello! I'm using this template for displaying folder items and sub-items:
{def $second_level_children=array()}
{def $root_node_children=fetch('content', 'list', hash('parent_node_id', 119, 'sort_by', array('name', true())))}
{if gt($root_node_children|count,0)}
<ul>
{foreach $root_node_children as $child}
<li class="menu-level-0">
<a href={$child.url_alias|ezurl()}><span class="arrowz">>></span> {$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 class="menu-level-1"><a href={$child2.url_alias|ezurl()}><span class="arrowz">></span> {$child2.name|wash()} </a></li>
{/foreach}
</ul>
{/if}
{/if}
{/foreach}
</ul>
{/if}
The content tree for this menu is looking like this :
// Root
--- item
--- item
-- sub-item
-- sub-item
-- etc...
--- item
--- item
--- item
--- etc..
When I'm opening sub-folder the sub-subitems are displaying in the left menu, but when I click on sub-subitem folder the menu is displaying only the contents of the root folder. How to make this code to fetch the subitems while viewing the sub-sub folder?
|