Share » Forums » Setup & design » Tree Menu: expand on current node

Tree Menu: expand on current node

Tree Menu: expand on current node

Monday 11 August 2003 8:13:18 am - 2 replies

Modified on Monday 11 August 2003 8:20:03 am by Johannes Becker

Author Message

Johannes Becker

Monday 18 August 2003 12:45:48 pm

no one?!

Björn Dieding@xrow.de

Monday 18 August 2003 2:55:47 pm

this is my tree menu with highlighting, it shows 3 levels (parent, current, children)

{* Set your top category here *}
{let top_cat=$#homedir
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))
parent_obj=fetch(content,node,hash(node_id,$node_obj.parent_node_id))
showed_image=first_set($node_obj.data_map.thumbnail,$node_obj.data_map.image,$parent_obj.image ,$parent_obj.data_map.thumbnail)
}
{section show=$showed_image.content}
<div class="xrowimagecenter">{attribute_view_gui attribute=$#showed_image image_class=medium}</div>
{section-else}
<div class="xrowimagecenter"><img src={"spacer.gif"|ezimage} width="200" height="150" border="0" alt=""></div>
{/section}
{* FIRST LEVEL *}
<table width="1" border="0" cellpadding="0" cellspacing="0">
{section show=$#hide|contains($parent_obj.node_id)}{section-else}<tr><td><nobr><img src={"menulevel1.gif"|ezimage} width="12" height="12" border="0" alt="{$parent_obj.name}"> <a class="path" href={$parent_obj.url_alias|ezurl}>{$parent_obj.name}</a></nobr></td></tr>{/section}
{section loop=fetch(content,list,hash(parent_node_id,$node_obj.parent_node_id))}
<tr><td><nobr>  {section show=eq($:item.node_id,$used_node)}<img src={"menulevel2active.gif"|ezimage} width="12" height="12" border="0" alt="{$:item.name}">
{section-else}<img src={"menulevel2.gif"|ezimage} width="12" height="12" border="0" alt="{$:item.name}">
{/section} <a class="path" href={$:item.url_alias|ezurl}>{$:item.name}</a></nobr></td></tr>
{* SECOND LEVEL *}
{section show=$node_obj.path_array|contains($:item.node_id) loop=fetch(content,list,hash(parent_node_id,$:item.node_id))}
<tr><td><nobr>    <img src={"menulevel3.gif"|ezimage} width="12" height="12" border="0" alt="{$:item.name}"> <a class="path" href={$:item.url_alias|ezurl}>{$:item.name}</a></nobr></td></tr>
{/section}
{/section}
</table>
{/let}
{/let}

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu