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.

eZ debug

Timing: Jan 18 2025 19:09:33
Script start
Timing: Jan 18 2025 19:09:33
Module start 'layout'
Timing: Jan 18 2025 19:09:33
Module start 'content'
Timing: Jan 18 2025 19:09:34
Module end 'content'
Timing: Jan 18 2025 19:09:34
Script end

Main resources:

Total runtime1.3666 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.3672152.6250
Module start 'layout' 0.00770.0034 741.992239.4453
Module start 'content' 0.01111.3539 781.4375547.0078
Module end 'content' 1.36500.0016 1,328.445312.1563
Script end 1.3666  1,340.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2683160.0002
Check MTime0.00150.1109160.0001
Mysql Total
Database connection0.00160.116910.0016
Mysqli_queries1.308595.7498570.0230
Looping result0.00060.0427550.0000
Template Total1.319296.520.6596
Template load0.00280.207320.0014
Template processing1.316496.322520.6582
Template load and register function0.00070.048210.0007
states
state_id_array0.00330.243310.0033
state_identifier_array0.00300.221220.0015
Override
Cache load0.00220.1639420.0001
Sytem overhead
Fetch class attribute can translate value0.00070.051520.0004
Fetch class attribute name0.00100.075040.0003
XML
Image XML parsing0.00070.052820.0004
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00080.0597160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs