Learning: Structuring Content

In eZ publish, content is structured using nodes and locations. Nodes are the tree structure that we normally would refer to as the sitemap. As there are times that we want to have a piece of content in more than one place in the site, an object can have multiple locations.

The content structure in eZ publish is created by nodes. Each node represents a part of the site. A publish object is then associated with a node to be a part of the content structure.

Nodes & Locations

Eg. Node ID 5 is associated with object ID 47.

This approach allows an object to be moved from one node to another without upsetting the site structure.

Locations

Objects can be associated with more than one node so that a particular object can appear in more than once place within the content structure. Each location is a combination of a node and an object.

For example, a particular object (in this case a news item) can be found in the news section (presented by node id 54) and in the press release section (represented by node id 75).

The concept of locations provides a simple mechanism for content reuse.

Visibility

By default, an object associated with a node will be visible on the site. However, there are times that you might want to hide a node after it has been published, eg. you have put up a press release but management have requested it be removed for political reasons. This is easily achieved by setting the node’s status to “hidden”. This means it will be visible in the administration section of the site but not visible to the public. Note: we are dealing with nodes, not the object. The node represents the site structure and changing what is visible or not is handled via the node.

A node has three visibility settings

a) visible (default)

b) hidden

c) hidden by superior

Once a node is hidden, all nodes beneath it in the tree are set as “hidden by superior”.

If the hidden node is set to visible, then all it’s children become visible (unless one of them has been individually set to hidden).

All of these settings can be override in the site.ini configuration file. For instance, it’s common to show hidden nodes in the administration interface.

This approach provides a high level of flexibility in hiding and displaying content on the site.