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.

eZ debug

Timing: Jan 20 2025 17:31:24
Script start
Timing: Jan 20 2025 17:31:24
Module start 'layout'
Timing: Jan 20 2025 17:31:24
Module start 'content'
Timing: Jan 20 2025 17:31:24
Module end 'content'
Timing: Jan 20 2025 17:31:24
Script end

Main resources:

Total runtime0.0142 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.0469151.2266
Module start 'layout' 0.00460.0021 739.273436.6797
Module start 'content' 0.00670.0060 775.953190.3125
Module end 'content' 0.01270.0015 866.265629.9922
Script end 0.0142  896.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.5927140.0002
Check MTime0.00117.6193140.0001
Mysql Total
Database connection0.00053.685810.0005
Mysqli_queries0.002114.980830.0007
Looping result0.00000.056910.0000
Template Total0.00128.210.0012
Template load0.00096.136310.0009
Template processing0.00032.057110.0003
Override
Cache load0.00064.479210.0006
General
dbfile0.002215.690580.0003
String conversion0.00000.041840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs