$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.