Forums / Setup & design / Tree Menu: expand on current node

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/

eZ debug

Timing: Jan 31 2025 01:15:28
Script start
Timing: Jan 31 2025 01:15:28
Module start 'content'
Timing: Jan 31 2025 01:15:28
Module end 'content'
Timing: Jan 31 2025 01:15:29
Script end

Main resources:

Total runtime0.2320 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.0859370.2891
Module start 'content' 0.00720.0126 959.37501,005.5313
Module end 'content' 0.01980.2121 1,964.90633,893.9922
Script end 0.2319  5,858.8984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00492.1181200.0002
Check MTime0.00150.6477200.0001
Mysql Total
Database connection0.00080.325910.0008
Mysqli_queries0.121552.37051410.0009
Looping result0.00190.81631390.0000
Template Total0.211791.210.2117
Template load0.00090.382010.0009
Template processing0.210890.863010.2108
Override
Cache load0.00060.276710.0006
Sytem overhead
Fetch class attribute can translate value0.00210.917410.0021
XML
Image XML parsing0.00030.119410.0003
General
dbfile0.00934.0054200.0005
String conversion0.00000.002430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs