Skip to the content
Documentation

The content node

No ratings yet

A node, also called a location, is the place of a content object in the content tree. The object holds the content; the node says where it sits, who its parent and children are, and at which address it is shown. Templates usually work with nodes: the full view of a page is the view of a node.

One object, several locations

An object gets its first node when it is published, below the parent chosen when it was created. Editors can add more locations in the edit form's Locations window or with Add locations, so one article can appear below both News and Archive without being copied. All locations show the same object and the same version; changing the object changes it everywhere.

  • The main location (main node) is the one the system uses when it needs one place: the object's main address, the default parent for breadcrumbs and the node that $object.main_node returns. Any location can be made the main one.
  • Removing a location removes only that node and its subtree. Removing the last location removes the object (to the trash).
  • Moving a node moves its whole subtree; the old address keeps working as a redirect (see URL translation).
  • The object's section is the same at every location; visibility is set per location.

What a node has

Property Meaning
Node ID A number that never changes; content/view/full/<node ID> always works.
Parent node The node above it.
Main node ID The node ID of the object's main location.
Depth How deep it is: the top level nodes have depth 1.
Path string The node IDs from the root, such as /1/2/58/72/; it makes subtree queries fast.
URL alias Its readable address, such as news/my-article.
Sort field and order How its children are sorted: by path, published date, modified date, section, depth, class identifier, class name, priority, name, modified subnode, node ID, object ID or visibility; ascending or descending.
Priority A number for sorting among siblings when the parent sorts by priority.
Hidden, invisible Visibility flags; see Node visibility.
Remote ID A unique text ID of the location.

Nodes in templates

{$node.name|wash}                       {* the object's name in the current language *}
{$node.node_id} {$node.parent_node_id} {$node.depth}
<a href={$node.url_alias|ezurl}>...</a>
{$node.object.id}                       {* the object behind it *}
{$node.data_map.title.content|wash}     {* its attributes *}
{foreach $node.path as $ancestor}{$ancestor.name|wash} / {/foreach}

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.