$object or $node data in a datatype edit template?

Author Message

Eric Weik

Wednesday 23 February 2005 6:35:32 am

In a custom datatype edit template (i.e. [extensionid]/design/standard/templates/content/datatype/edit/), what variables are available besides $attribute (i.e. is there a way to get $object or $node?).

Basically, I am currently working on a project where and the editing process could be made much more user-friendly if attribute editing templates could look up where the object is in the content tree.

Eric Weik

Wednesday 23 February 2005 7:21:10 am

Well, it turns out I found my own answers with a bit more digging:

$attribute.object: object this attribute belongs to.

Once you have an object, you can use the following to get its parent node in the content tree:

{let parent_node=fetch(content, node, hash( node_id, $attribute.object.current.main_parent_node_id ))}
  {* code here... *}
{/let}

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 31 2025 04:13:58
Script start
Timing: Jan 31 2025 04:13:58
Module start 'layout'
Timing: Jan 31 2025 04:13:58
Module start 'content'
Timing: Jan 31 2025 04:13:58
Module end 'content'
Timing: Jan 31 2025 04:13:58
Script end

Main resources:

Total runtime0.0139 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.2656151.2266
Module start 'layout' 0.00460.0022 739.492236.6797
Module start 'content' 0.00680.0057 776.171990.2188
Module end 'content' 0.01250.0014 866.390629.9922
Script end 0.0139  896.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002215.6142140.0002
Check MTime0.00107.3626140.0001
Mysql Total
Database connection0.00074.767710.0007
Mysqli_queries0.002215.795430.0007
Looping result0.00000.087210.0000
Template Total0.00117.610.0011
Template load0.00085.815610.0008
Template processing0.00021.600110.0002
Override
Cache load0.00053.930010.0005
General
dbfile0.001913.925380.0002
String conversion0.00000.061540.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