Find topmost node id after node 2

Author Message

Børge Warvik

Wednesday 19 April 2006 3:49:07 am

Hi

Given this structure
-----------------------------------
Home (node 2)
| - Blog (node 3)
| - Articles (node 4)
| - - Programming (node 6)
| - - - Javascript (node 8)
| - - - PHP (node 9)
| - - Database (node 7)
| - Contact (node 5)
-----------------------------------

When user clicks on Javascript (node 8) how can I find the top most node after node 2? In this case node 4 Articles.

Thanks,
Børge

Präßler Sven

Wednesday 19 April 2006 5:44:49 am

To get the main top Node ID after the ezpublish root node you can use

{def $topID = $node.path_array.2}

Børge Warvik

Wednesday 19 April 2006 5:48:24 am

Thanks!

So in this case the $node.path_array for node 8 will be 2, 4, 6, 8?

Präßler Sven

Wednesday 19 April 2006 5:51:51 am

In this case it will be 1,2,4,6,8

Børge Warvik

Wednesday 19 April 2006 6:01:12 am

I see!

Great, thanks!
Børge

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

Main resources:

Total runtime0.9258 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.0703152.6250
Module start 'layout' 0.00540.0033 741.695339.4453
Module start 'content' 0.00870.9157 781.1406526.7031
Module end 'content' 0.92440.0013 1,307.843812.1563
Script end 0.9258  1,320.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3427160.0002
Check MTime0.00140.1475160.0001
Mysql Total
Database connection0.00070.071510.0007
Mysqli_queries0.873794.3773630.0139
Looping result0.00060.0630610.0000
Template Total0.893496.520.4467
Template load0.00190.209720.0010
Template processing0.891496.289620.4457
Template load and register function0.00010.008410.0001
states
state_id_array0.00110.114610.0011
state_identifier_array0.00090.095620.0004
Override
Cache load0.00170.1813330.0001
Sytem overhead
Fetch class attribute can translate value0.00120.129220.0006
Fetch class attribute name0.00130.137960.0002
XML
Image XML parsing0.00050.058120.0003
class_abstraction
Instantiating content class attribute0.00000.001880.0000
General
dbfile0.00120.1273160.0001
String conversion0.00000.000840.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs