Forums / Install & configuration / Parent Node ID

Parent Node ID

Author Message

Christoph Schneider

Wednesday 29 January 2003 11:25:05 am

How do I get the node ID of the parent node of the current node?

I want to achieve the following:
In a full view template of an article, I want to show "related articles", ie. articles about the same topic. The "topic" is the parent node of the articles, so I want a list of all children for the parent node of the current node (current article).

fetch(content,list,hash(parent_node_id,[...insert statement here...]))

Bruce Morrison

Wednesday 29 January 2003 6:42:30 pm

> How do I get the node ID of the parent node of the current
> node?
>
> I want to achieve the following:
> In a full view template of an article, I want to show
> "related articles", ie. articles about the same topic. The
> "topic" is the parent node of the articles, so I want a list
> of all children for the parent node of the current node
> (current article).
>
> fetch(content,list,hash(parent_node_id,[...insert statement
> here...]))

$node.parent_node_id

is what you are looking for

bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Christoph Schneider

Monday 03 February 2003 2:25:27 am

Thank you, Bruce.
In addition, I found the following message very helpful... so if anyone has a similar problem:
http://developer.ez.no/forum/message/14007/

Bruce Morrison

Monday 03 February 2003 8:47:04 pm

> Thank you, Bruce.
> In addition, I found the following message very helpful...
> so if anyone has a similar problem:
> http://developer.ez.no/forum/message/14007/

Of interest to get the grandparent id
{$node.parent.parent_node_id}

Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Alexei Pechekhonov

Tuesday 04 February 2003 7:58:03 am

> > so if anyone has a similar problem:

> Of interest to get the grandparent id
> {$node.parent.parent_node_id}
>
> Bruce
Really nice solution.
But i meet another strange effect.
Yes, I can see $node.node_id, $node.parent_node_id etc... - BUT ! only first time , before cache wasn't created.
I have to clean cache for correct reflection and on second and next times i have nothing till the cache will be cleaned again .
(winXP, ProcessCaching=disabled)
Did you have the same thing ?

Bruce Morrison

Monday 17 February 2003 9:49:57 pm

> > > so if anyone has a similar problem:
>
> > Of interest to get the grandparent id
> > {$node.parent.parent_node_id}
> >
> > Bruce
> Really nice solution.
> But i meet another strange effect.
> Yes, I can see $node.node_id, $node.parent_node_id etc... -
> BUT ! only first time , before cache wasn't created.
> I have to clean cache for correct reflection and on second
> and next times i have nothing till the cache will be cleaned
> again .
> (winXP, ProcessCaching=disabled)
> Did you have the same thing ?

Am seeing this now that I have turned on caching. It seems that the $node variable is not availaiable to the cached page.

Did you find a solution to this?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Paul Borgermans

Tuesday 18 February 2003 2:40:37 am

> > > > so if anyone has a similar problem:
> >
> > > Of interest to get the grandparent id
> > > {$node.parent.parent_node_id}
> > >
> > > Bruce
> > Really nice solution.
> > But i meet another strange effect.
> > Yes, I can see $node.node_id, $node.parent_node_id etc...
> -
> > BUT ! only first time , before cache wasn't created.
> > I have to clean cache for correct reflection and on
> second
> > and next times i have nothing till the cache will be
> cleaned
> > again .
> > (winXP, ProcessCaching=disabled)
> > Did you have the same thing ?
>
> Am seeing this now that I have turned on caching. It seems
> that the $node variable is not availaiable to the cached
> page.
>
> Did you find a solution to this?
>
> Cheers
> Bruce

You can use the {$module_result.node_id} for fetch functions. This will also work on cached pages.

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

eZ debug

Timing: Jan 18 2025 10:23:55
Script start
Timing: Jan 18 2025 10:23:55
Module start 'content'
Timing: Jan 18 2025 10:23:56
Module end 'content'
Timing: Jan 18 2025 10:23:56
Script end

Main resources:

Total runtime0.9111 sec
Peak memory usage4,096.0000 KB
Database Queries210

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 587.7031180.8438
Module start 'content' 0.00780.7882 768.5469674.2109
Module end 'content' 0.79600.1151 1,442.7578341.6953
Script end 0.9110  1,784.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00520.5696210.0002
Check MTime0.00210.2326210.0001
Mysql Total
Database connection0.00110.125210.0011
Mysqli_queries0.816889.65272100.0039
Looping result0.00220.23822080.0000
Template Total0.875696.120.4378
Template load0.00290.313520.0014
Template processing0.872895.789520.4364
Template load and register function0.00010.015010.0001
states
state_id_array0.00110.124310.0011
state_identifier_array0.00120.127720.0006
Override
Cache load0.00270.29631000.0000
Sytem overhead
Fetch class attribute can translate value0.00140.156350.0003
Fetch class attribute name0.00110.124190.0001
XML
Image XML parsing0.00140.150550.0003
class_abstraction
Instantiating content class attribute0.00000.0025110.0000
General
dbfile0.00340.3761340.0001
String conversion0.00000.001230.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 33
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs