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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.