Felix Laate
|
Thursday 10 February 2005 5:32:59 am
Hi! I'm sure there are many better ways than this one, but anyways...
{* Set your top category here *}
{let top_cat=2 used_node=false()}
{* See if we have already a node id otherwise use the top category as current node *}
{section show=is_set($DesignKeys:used.node)}
{set used_node=$DesignKeys:used.node}
{section-else}
{set used_node=$top_cat}
{/section}
{* Get a proper node object *}
{let node_obj=fetch(content,node,hash(node_id,$used_node))}
<ul id="nav">
{* FIRST LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$top_cat,
limit, 6,
class_filter_type, "include",
class_filter_array, array(1),
sort_by,array(array(priority))))}
{* check if container *}
{switch match=$:item.object.content_class.is_container}
{* container *}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
{* fiks 1 start *}
{let c1=fetch(content,list,hash(parent_node_id,$:item.node_id))}
{section show=$c1}
<ul>
{* SECOND LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$:item.node_id,
class_filter_type, "include",
class_filter_array, array(1),
sort_by,array(array(priority))))}
{* check if container *}
{switch match=$:item.object.content_class.is_container}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
{* fiks 2 start *}
{let c2=fetch(content,list,hash(parent_node_id,$:item.node_id))}
{section show=$c2}
<ul>
{* THIRD LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$:item.node_id,
class_filter_type, "include",
class_filter_array, array(1),
sort_by,array(array(priority))))}
{* check if container *}
{switch match=$:item.object.content_class.is_container}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
{* fiks 3 start *}
{let c3=fetch(content,list,hash(parent_node_id,$:item.node_id))}
{section show=$c3}
<ul>
{* FOURTH LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$:item.node_id,
class_filter_type, "include",
class_filter_array, array(1),
sort_by,array(array(priority))))}
{* check if container *}
{switch match=$:item.object.content_class.is_container}
{case match=1}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a>
{* fiks 4 start *}
{let c4=fetch(content,list,hash(parent_node_id,$:item.node_id))}
{section show=$c4}
<ul>
</ul>
{section-else}
{/section}
{/let}
{* fiks slutt *}
</li>
{/case}
{case}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}
</ul>
{section-else}
{/section}
{/let}
{* fiks slutt *}
</li>
{/case}
{case}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}
</ul>
{section-else}
{/section}
{/let}
{* fiks slutt *}
</li>
{/case}
{case}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}
</ul>
{section-else}
{/section}
{/let}
{* fiks slutt *}
</li>
{/case}
{case}
{* not container *}
<li><a class="path" href={concat("/content/view/full/",$:item.node_id,"/")|ezurl}>{$:item.name}</a></li>
{/case}
{/switch}
{/section}
</ul>
{/let}
{/let}
</div>
I used this together with the http://www.csscreator.com/menu/multimenu.php to create (horizontal) dynamic menus. Skip it and it can be made static. Hope it helps! Felix
Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com
|