christian leu
|
Friday 16 July 2004 2:39:18 am
i use the following code for my menu on www.proeda.net. as i like to make the site multilingual and will not use the translation feature, i need a solution to start the menu on root, but dont show the first level. could anyone help me with this?
{* Set your top category here *}
{let top_cat=114 counter=0 flag_section2=0 flag_section2=0
used_node=false() teststring=""}
{* 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))}
{* FIRST LEVEL *}
{section loop=fetch(content,list,hash(parent_node_id,$top_cat, class_filter_type, "include", class_filter_array, array(1,2,3,8,10),sort_by,array(array(priority))))}
{set counter=$:counter|inc}
{set flag_section2=0}
{set flag_section3=0}
{section name=ultop show=$:counter|eq(1)}
<ul id="menutop">
{/section}
{section name=ulrest show=$:counter|eq(2)}
</ul>
<ul id="menu">
{/section}
{section show=eq($:item.node_id,$used_node)}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="navactive"><img src={"square_red.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a>
{section-else}
{section show=$node_obj.path_array|contains($:item.node_id)}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="navactive"><img src={"square_red.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a>
{section-else}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="nav"><img src={"square_grey.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a>
{/section}
{/section}
{* SECOND LEVEL *}
{section show=$node_obj.path_array|contains($:item.node_id)}
{set flag_section2=1}
<ul class="submenu">
{/section}
{section show=$node_obj.path_array|contains($:item.node_id) loop=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1,2,3,8,10),sort_by,array(array(priority))))}
{section show=eq($:item.node_id,$used_node)}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="subnavactive"><img src={"square_red.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a>
{section-else}
{section show=$node_obj.path_array|contains($:item.node_id)}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="subnavactive"><img src={"square_red.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a>
{section-else}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="subnav"><img src={"square_grey.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a>
{/section}
{/section}
{* THIRD LEVEL *}
{section show=$node_obj.path_array|contains($:item.node_id) loop=fetch(content,list,hash(parent_node_id,$:item.node_id, class_filter_type, "include", class_filter_array, array(1,2,3,8,10),sort_by,array(cond($:item.node_id|ne(117),array("priority"),array("published",false())))))}
<ul class="submenu2">
{section show=eq($:item.node_id,$used_node)}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="subnavactive2"><img src={"square_red.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a></li>
{section-else}
<li><a href={concat("/content/view/full/",$:item.node_id,"/")|ezurl} class="subnav2"><img src={"square_grey.gif"|ezimage} width="7" height="7" border="0" alt="NavigationSquare">{$:item.name}</a></li>
{section show=$node_obj.path_array|contains($:item.node_id)}
{/section}
{/section}
</ul>
{/section}
</li>
{/section}
{* END SECOND LEVEL *}
{section name=closeulsec2 show=$:flag_section2|eq(1)}
</ul><br />
{/section}
{* END FIRST LEVEL *}
</li>
{/section}
|