Left menu with dynamic root node

Author Message

Nicolò Zanetti

Tuesday 04 December 2007 1:32:42 am

Hi,
I have a standard flat left menu (ezwebin extension, 3.10).
I noticed that the root node of this menu is set by the variable $pagerootdepth that is in the pagelayout.tpl.
I would like to override this variable in the flat_left.tpl, to obtain the current node as root of the menu. (menu will display sons of current node).
In the first row of flat_left.tpl i will add $pagerootdepth=???.

Thanks in advance, Nicolò

Salvatore Guarino

Tuesday 04 December 2007 2:18:47 am

Try to add this line:

{set $pagerootdepth = $module_result.content_info.node_depth|sum(-1)}

Nicolò Zanetti

Tuesday 04 December 2007 3:01:34 am

Well it works fine, it's exactly what i need... but it generates a bug in the menu title :( .
Actually, without the script the menu title when clicked redirect to the page that give the name to the menu title, with the script it redirect you to the home page.
I must find a way to correct this.

Nicolò Zanetti

Tuesday 04 December 2007 5:15:21 am

I just deleted the link part of the menu title script, and the menu title is correct even if unlinked, anyway it would have redirected to the same page, so it was a totally useless link.
Ty

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:22:58
Script start
Timing: Jan 18 2025 19:22:58
Module start 'layout'
Timing: Jan 18 2025 19:22:58
Module start 'content'
Timing: Jan 18 2025 19:22:59
Module end 'content'
Timing: Jan 18 2025 19:22:59
Script end

Main resources:

Total runtime0.6190 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.9219152.6250
Module start 'layout' 0.00590.0030 740.546939.4453
Module start 'content' 0.00890.6086 779.9922514.6563
Module end 'content' 0.61760.0014 1,294.648412.1563
Script end 0.6190  1,306.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5387160.0002
Check MTime0.00130.2158160.0001
Mysql Total
Database connection0.00070.109010.0007
Mysqli_queries0.572092.4078600.0095
Looping result0.00060.0922580.0000
Template Total0.591695.620.2958
Template load0.00210.339120.0010
Template processing0.589495.219420.2947
Template load and register function0.00020.025810.0002
states
state_id_array0.00100.156210.0010
state_identifier_array0.00100.169620.0005
Override
Cache load0.00180.2835200.0001
Sytem overhead
Fetch class attribute can translate value0.00090.143620.0004
Fetch class attribute name0.00130.215550.0003
XML
Image XML parsing0.00080.130920.0004
class_abstraction
Instantiating content class attribute0.00000.002050.0000
General
dbfile0.00100.1666170.0001
String conversion0.00000.001340.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs