Tree Menu: expand on current node

Author Message

Johannes Becker

Monday 11 August 2003 8:13:18 am

In addition to <http://ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/creating_tree_menus> I wondered that there's no `clean' solution that makes it possible to navigate not only trough 3 subnodes.

I figured out that there's a function called "SubTreeCount" somewhere in ezcontentobjecttreenode.php, but didn't get it working the way I want to.

I mean, i can work with the solution posted in the `tips and tricks'.. but, why using a 'killer app' if it's not able to solve this correctly? I'm sure I missed something due to I'm a newbie to ezP.

Thanks for your help/hints in advance! :>

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/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.