Forums / Setup & design / relation between object_id and node_id?

relation between object_id and node_id?

Author Message

Nicolas Heiringhoff

Thursday 29 April 2004 6:50:57 am

If I can fetch the object_id of an object I am just editing with

 {$object.id}

, how can I get the node_id that is associated with the object? In other words: is it possible to get the node_id of an object, if I have the object_id, but do not know the node_id, where it is published? Which code can get me the node_id?

Thanks for your help!

http://www.heiringhoff.de

Plamen Petkov

Wednesday 05 May 2004 3:00:26 am

{$node.object|attribute(show)}

Search the resulting page for "node". There you will find attributes of the object giving the info you are looking for.

main_parent_node_id: Integer (perhaps, the first (hence "main") node in the tree pointing to the object; I am not sure)
parent_nodes: Array (of node IDs)
node_assignments: Array (of node IDs)

Why Arrays?
Because: a given object CAN be pointed by more than 1 node; the answer of the question "Which node points to this objects?" is undefined in terms of a single node ID.

regards