Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Node attributes reference

Every attribute a template can read from a node (eZContentObjectTreeNode) - the 16 database fields and the 35 function attributes of its definition, the PHP method behind each, and the value each returned for a real…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/help/template-language/node-attributes-reference.md

On this page

Node attributes reference

$node in a node template is an eZContentObjectTreeNode (kernel/classes/ezcontentobjecttreenode.php). What a template can read from it is exactly what eZContentObjectTreeNode::definition() lists: the database fields of the ezcontentobject_tree table and the function_attributes, which call a PHP method each time they are read (see The object model in templates for the protocol).

Contents

  1. How this table was made
  2. Database fields
  3. Function attributes
  4. A sample
  5. Notes
  6. Related pages

How this table was made

A read-only CLI script on a development installation (run with bin/php/ezexec.php -s site as the web server's user) called eZContentObjectTreeNode::definition(), listed fields and function_attributes, and read each name with $node->attribute( $name ) on node 96, an ng_article. The "Value on a development installation" column is the PHP type and, for short values, the value it returned. The script runs as the anonymous user, so the can_* checks show what an anonymous visitor may do. The core of it:

$node = eZContentObjectTreeNode::fetch( 96 );
$def = $node->definition();
foreach ( $def['fields'] as $name => $field )
    echo $name, ' ', $field['name'], ' ', $field['datatype'], "\n";
foreach ( $def['function_attributes'] as $name => $method )
    echo $name, ' ', $method, ' ', gettype( $node->attribute( $name ) ), "\n";

Database fields

AttributeDatabase column / memberDatatypeValue on a development installation (node 96)
node_idNodeIDintegerinteger 96
parent_node_idParentNodeIDintegerinteger 92
main_node_idMainNodeIDintegerinteger 96
contentobject_idContentObjectIDintegerinteger 94
contentobject_versionContentObjectVersionintegerinteger 1
contentobject_is_publishedContentObjectIsPublishedintegerinteger 1
depthDepthintegerinteger 4
sort_fieldSortFieldintegerinteger 2
sort_orderSortOrderintegerinteger 0
priorityPriorityintegerinteger 0
modified_subnodeModifiedSubNodeintegerinteger 1790970543
path_stringPathStringstringstring "/1/2/89/92/96/"
path_identification_stringPathIdentificationStringtextstring (59 bytes)
remote_idRemoteIDstringstring "media-n-729"
is_hiddenIsHiddenintegerinteger 0
is_invisibleIsInvisibleintegerinteger 0

Function attributes

remote_id is in both lists; the function attribute (remoteID()) is the one a template reads.

Function attributePHP methodValue on a development installation (node 96)
nameeZContentObjectTreeNode::getName()string "Why Should You Choose Strength Training?"
data_mapeZContentObjectTreeNode::dataMap()array(18) of eZContentObjectAttribute
remote_ideZContentObjectTreeNode::remoteID()string "media-n-729"
objecteZContentObjectTreeNode::object()object eZContentObject
subtreeeZContentObjectTreeNode::subTree()array(0)
childreneZContentObjectTreeNode::children()array(0)
children_counteZContentObjectTreeNode::childrenCount()integer 0
view_counteZContentObjectTreeNode::viewCount()integer 0
contentobject_version_objecteZContentObjectTreeNode::contentObjectVersionObject()object eZContentObjectVersion
sort_arrayeZContentObjectTreeNode::sortArray()array(1) of array
can_readeZContentObjectTreeNode::canRead()boolean true
can_pdfeZContentObjectTreeNode::canPdf()boolean true
can_createeZContentObjectTreeNode::canCreate()boolean true
can_editeZContentObjectTreeNode::canEdit()boolean false
can_hideeZContentObjectTreeNode::canHide()boolean false
can_removeeZContentObjectTreeNode::canRemove()boolean false
can_moveeZContentObjectTreeNode::canMoveFrom()boolean false
can_move_fromeZContentObjectTreeNode::canMoveFrom()boolean false
can_add_locationeZContentObjectTreeNode::canAddLocation()boolean false
can_remove_locationeZContentObjectTreeNode::canRemoveLocation()boolean false
can_view_embedeZContentObjectTreeNode::canViewEmbed()boolean false
is_maineZContentObjectTreeNode::isMain()boolean true
creatoreZContentObjectTreeNode::creator()object eZContentObject
path_with_nameseZContentObjectTreeNode::pathWithNames()string (59 bytes)
patheZContentObjectTreeNode::fetchPath()array(3) of eZContentObjectTreeNode
path_arrayeZContentObjectTreeNode::pathArray()array(5) of integer
parenteZContentObjectTreeNode::fetchParent()object eZContentObjectTreeNode
urleZContentObjectTreeNode::url()string (47 bytes)
url_aliaseZContentObjectTreeNode::urlAlias()string (47 bytes)
class_identifiereZContentObjectTreeNode::classIdentifier()string "ng_article"
class_nameeZContentObjectTreeNode::className()string "NG Article"
hidden_invisible_stringeZContentObjectTreeNode::hiddenInvisibleString()string "-/-"
hidden_status_stringeZContentObjectTreeNode::hiddenStatusString()string "Visible"
classes_js_arrayeZContentObjectTreeNode::availableClassesJsArray()string (3218 bytes)
is_containereZContentObjectTreeNode::classIsContainer()integer 1

A sample

A few of these attributes on node 89, the "Fit & Healthy" front page:

{def $node = fetch( 'content', 'node', hash( 'node_id', 89 ) )}
name:            {$node.name|wash}
class:           {$node.class_identifier} ({$node.class_name|wash})
url_alias:       {$node.url_alias}
path_string:     {$node.path_string}
depth:           {$node.depth}
children_count:  {$node.children_count}
sort_array:      {$node.sort_array.0|implode( ', ' )}
is_main:         {cond( $node.is_main, 'yes', 'no' )}
hidden status:   {$node.hidden_status_string}
can_read:        {cond( $node.can_read, 'yes', 'no' )}, can_edit: {cond( $node.can_edit, 'yes', 'no' )}
current user:    {fetch( 'user', 'current_user' ).login}

Output:

name:            Fit & Healthy
class:           ng_frontpage (NG Frontpage)
url_alias:       
path_string:     /1/2/89/
depth:           2
children_count:  16
sort_array:      published, 1
is_main:         yes
hidden status:   Visible
can_read:        yes, can_edit: no
current user:    anonymous

Notes

  • url_alias of node 89 is empty. The siteaccess site has a path prefix ([SiteAccessSettings] PathPrefix), and urlAlias() removes that prefix from the start of the alias; node 89 is the node at the prefix itself. path_with_names is the full alias path without that step, and url returns url_alias while [URLTranslator] Translation is enabled, else content/view/full/<node id>:
{def $node = fetch( 'content', 'node', hash( 'node_id', 96 ) )}
PathPrefix:      {ezini( 'SiteAccessSettings', 'PathPrefix' )}
path_with_names: {$node.path_with_names}
url_alias:       {$node.url_alias}
url:             {$node.url}

Output:

PathPrefix:      fit-healthy
path_with_names: fit-healthy/fitness/why-should-you-choose-strength-training
url_alias:       fitness/why-should-you-choose-strength-training
url:             fitness/why-should-you-choose-strength-training
  • sort_array is a list of array( sort field, ascending ) pairs, the node's child sort order as fetch( 'content', 'list' ) understands it (here: by publishing date, ascending is 1).
  • children, subtree and children_count run a query each time they are read. In a list with many items use fetch( 'content', 'list', ... ) with limit instead (see Fetch performance).
  • can_read, can_edit, can_hide, can_remove, can_move, can_create check the current user's policies on this location; their results depend on who views the page, which is why such checks belong outside view-cached output or in templates whose cache varies by role (the content view cache keys include the user's role IDs).
  • classes_js_array returns a JavaScript array string for the admin's "create here" menu; site templates do not need it.
  • creator returns the content object of the user who created the version stored on this node.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x