Fetching nodes under a node's grandparent?

Author Message

Jason Filby

Thursday 04 September 2003 1:01:54 pm

Hi, I need to get a fetch going that retrieves all nodes under the current node's grandparent. Written another way I need to get all node's at the level of the node's parent node.

I can't seem to get this working - any help is appreciated.

Thanks
Jason

Paul Forsyth

Thursday 04 September 2003 1:36:42 pm

Your current node has a link to its parent. Look at:

{$node|attribute(show)}

and you will see the syntax you need.

It is something like:

{let parent_node = fetch('content','node',hash(node_id,$node.parent_node_id)}

With this $parent_node you can some perform a standard fetch on its parent, like this:

{let nodes = fetch('content','list',hash(parent_node_id,$parent_node.node_id)}

which will grab all the nodes underneath the parent.

There may be a direct way to reach the id of the parents parent, look at the results of the attribute(show) call above. I can't experiment at the moment to confirm this.

Hope this helps

Paul

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 30 2025 21:37:51
Script start
Timing: Jan 30 2025 21:37:51
Module start 'layout'
Timing: Jan 30 2025 21:37:51
Module start 'content'
Timing: Jan 30 2025 21:37:51
Module end 'content'
Timing: Jan 30 2025 21:37:51
Script end

Main resources:

Total runtime0.0271 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.2578151.2266
Module start 'layout' 0.00450.0046 739.4844220.7188
Module start 'content' 0.00910.0163 960.2031997.6953
Module end 'content' 0.02540.0017 1,957.898429.9922
Script end 0.0270  1,987.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002910.8714140.0002
Check MTime0.00124.5364140.0001
Mysql Total
Database connection0.00062.195110.0006
Mysqli_queries0.00279.827630.0009
Looping result0.00000.047610.0000
Template Total0.00124.310.0012
Template load0.00093.192210.0009
Template processing0.00031.057010.0003
Override
Cache load0.00062.220610.0006
General
dbfile0.002710.009180.0003
String conversion0.00000.025540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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