Share » Learn » eZ Publish » Node Visibility: Hiding and Revealing...

Node Visibility: Hiding and Revealing Content

Wednesday 03 September 2008 7:05:00 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

We have previously seen in this article that it is possible to create restricted areas by applying access permissions to sections. The hide / show feature also denies access, but is applied directly to nodes, without requiring section or permission management. Usually, it is used to prevent the display of content for all users on a siteaccess, and is therefore most suitable for temporary unavailability of content (for example, if you are working on a new area of a site).

Node visibility (or "visibility" for short) refers to whether some published content can be viewed, generally on the front-end of a site. The effect of hiding a node is that the node in question, and all of its descendants, disappears from the front-end pages while still being accessible from the Administration Interface. This behavior is regulated by an INI setting, as described later.

A visible node is only shown if it is allowed by the permission system. In other words, when the system determines whether or not to show a node, access control comes first, then node visibility.

The following illustration shows a part of a node tree with two main branches. The direct descendant of the left branch has been hidden (by a user), while the node of the right branch is visible.

Content node tree with a hidden subtree

Suppose that you hide a folder containing all your products. Both the folder itself and the products will not be shown on the front-end of the site. Then you can, for example, update price information for the whole shop before revealing it to site visitors once again.

Keep in mind that visibility is applied to nodes, not objects. If you hide one location of an object, its other locations might still be visible.

Visibility statuses

"Visibility status" refers to whether a node (and content located below it) should be displayed and if not, whether it has been explicitly or implicitly hidden. A node has one of the following three visibility statuses: "visible", "hidden", or "hidden by superior".

Nodes with the "hidden" or "hidden by superior" status are not displayed on the front-end of a site, although there are different reasons as to why they are not displayed (as explained in the table below). Because the end result is the same in both cases, the terms "hidden", "invisible", "not shown" and "not displayed" are all commonly used to describe nodes with the "hidden" and "hidden by superior" statuses.

The table below summarizes the visibility statuses:

Visibility status Description
Visible This is the default status. When the node is accessed, the object encapsulated by this node is displayed.
Hidden The node is invisible and the referenced object is not displayed. This node was explicitly hidden by a content manager or another user with sufficient permissions. All nodes below it in the subtree are also invisible (with either a "hidden" or "hidden by superior" status).
Hidden by superior The node is invisible and the referenced object is not displayed. A node with this status has a node with the "hidden" status somewhere above it in the content node tree (this can be a direct parent node or one of its ancestors). In other words, it has been indirectly hidden by the system because of a hide operation further up in the tree.

Status propagation

When you alter the visibility of a node, this has an effect down the entire subtree. For content managers, this means that you can quickly hide or reveal entire subtrees, although you must be conscious of whether nodes have "hidden" or "hidden by superior" statuses.

For example, when you hide a node, all of the node's visible children are automatically given the "hidden by superior" status.

36 542 Users on board!

Tutorial menu

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)