Forums / Setup & design / node_id, object_id, idontgetit_id
padEE Scherer
Wednesday 11 June 2003 1:13:15 am
i'm lost. i've read the docs, the forum messages, but nowhere is explained, which id is assigned how to which object oder which node. example: in the site.ini for demo you'll find the following:
[SiteSettings]IndexPage=/content/view/full/26
but the only number equals to 26 you'll find in the admin section is in 'set up > classes > media' the file object. so, i quess, 26 is the node number. alright, but where do i specify this node number? where can i check this number?
if i define a new object with new views... how are the nodes assigned to it?
cheers,padEE
Gunnstein Lye
Wednesday 11 June 2003 3:03:00 am
Just to make this clear: object_id is the ID of the object. node_id is the ID of one of the nodes of an object. A node is a placement in the content tree.
When you view an object, you view it from a certain location (placement), so the number after /content/view/full/ is the node id. When editing an object, the nodes are irrelevant, so the number after /content/edit/ is the object id.
You can not specify node ids, the system does that. How to find the node id of a given node? Look at the link, the node id is the number after /content/view/full/.
Nodes are assigned whenever you specify locations for an object.
Chris Winchester
Wednesday 13 August 2003 10:26:58 am
I'm having some trouble with the object_id / node_id thing.
I'm building a PHP extension which needs to retreive those objects which are parents of a particular content object. The parent_nodes attribute gives me a list of their node_id's, but the eZContentObject::fetch function which I need to use to retrieve the content of these objects requires object_ids.
Is there anyway to use eZContentObject::fetch or something similar with node_ids instead, or is there some way to map node_ids to object_ids?
Any help would be much appreciated - thanks!- Chris
Thursday 14 August 2003 4:39:21 am
iDOgetit_id!!
Glad I slept on this. I've just made a bit of a breakthrough in understanding how this works.
I was using eZContentObject::fetch($object_id) but I didn't realise I could use eZContentObjectTreeNode::fetch($node_id) to get straight to the requried node. You can then retreive the associated content object id using:
$wantedNode = eZContentObjectTreeNode::fetch($node_id); $wantedObjectID = $wantedNode->attribute('contentobject_id');$wantedObject = eZContentObject::fetch($wantedObjectID);
It's very simple once you know how - just really difficult to find what you need amongst all the available functions etc.
I do love eZpublish, but it can be a bit frustrating at times!!
- Chris