Finding the node id number of a child object

Author Message

Frey Staso

Friday 04 March 2005 4:48:13 pm

I've been searching for the code all day that will allow me to get the node id of a child. Specifically I am viewing a folder that lists the contents of each object and includes an edit and delete button. I can get both buttons to function as long as the node id number is hard coded in, but I would rather have a variable generated dynamically.

Everything I've seen is just code to tell the PARENT of an object or the node of the object you are currently viewing. Is there code I can use to show the node number of the my child objects?

code looks basically like this

{let name=test counter=0 children=fetch( content,
list,
hash( parent_node_id,
$node.node_id,
sort_by,
$node.sort_array
)
)
}</p>

{* Loop through all the entries. *}
{section loop=$:children}

{* Increment the counter by one. *}
{set counter=$:counter|inc}

Week Starting: {$:item.data_map.start.data_int|l10n(shortdate)} - {$:item.data_map.end.data_int|l10n(shortdate)}

onday:{$:item.object.data_map.mon.content|wash} Tuesday:{$:item.object.data_map.tues.content|wash}
Wednesday:{$:item.object.data_map.wed.content|wash}
Thursday:{$:item.object.data_map.thurs.content|wash}
Friday:{$:item.object.data_map.fri.content|wash}</td>


{/section}

Eivind Marienborg

Friday 04 March 2005 10:45:53 pm

You can generally find the node id by simply adding node_id to e.g. $node or $:item, like this:

Week Starting: {$:item.data_map.start.data_int|l10n(shortdate)} - {$:item.data_map.end.data_int|l10n(shortdate)}

NODE_ID: {$:item.node_id}

- Eivind

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