This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Install & configuration » Parent Node ID
expandshrink

Parent Node ID

Parent Node ID

Wednesday 29 January 2003 8:25:05 pm - 6 replies

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...]))

Thursday 30 January 2003 3:42:30 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...]))

$node.parent_node_id

is what you are looking for

bruce

Monday 03 February 2003 11: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/

Tuesday 04 February 2003 5:47:04 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/

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

Bruce

Tuesday 04 February 2003 4:58:03 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 ?

Tuesday 18 February 2003 6:49:57 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

Tuesday 18 February 2003 11: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.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from