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

Node Visibility: Hiding and Revealing Content

Thursday 04 September 2008 4:05:00 am

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

Requirements for working with hidden content

If a user has the appropriate permissions in a given situation to access visible nodes, he or she can also view hidden nodes if the current siteaccess is configured to show hidden nodes.

The site.ini configuration file contains a "ShowHiddenNodes" setting in the "[SiteAccessSettings]" block. Typically, this is set to "false" for all of the site.ini siteaccess overrides except for the Administration Interface siteaccess (where it is set to "true"). See the online eZ Publish documentation for more information on INI files.

In order to be able to toggle the visibility status of a node, the user's account or user group must have been assigned a role with a policy granting access to the "hide" function (or all functions) of the "content" module. Otherwise, you must modify or assign the appropriate policy, as described in this article.

A user can hide and reveal a node using the Administration Interface, given that the above described requirements are met. As you will see, your most important tools in this case are the Locations window and the context-sensitive pop-up menu.

Note that the terms "reveal", "show" and "unhide" all refer to the same operation on a node.

The effect of hiding or revealing a node differs depending on whether its parent is visible or invisible. Recall that you can hover over a node in the left menu to show its visibility status. Also, the hide / reveal action will propagate down the subtree starting at the target node, and affecting its descendants, as we will demonstrate.

Altering the visibility status

To explicitly hide or reveal a node, locate it in the left tree menu, bring up the pop-up menu, and select the "Hide / unhide" item under the "Advanced" sub-menu. The system will change the visibility status of the target node. (If the node has the "hidden by superior" status, this will give it the "hidden" status.)

Hiding a node through the pop-up menu

If you cannot use the above approach (if your browser does not have JavaScript enabled or your left menu only displays a subset of content classes that excludes your target node), follow the procedure below:

  1. Navigate to your target node and make sure it is displayed in the main area of the Administration Interface. Enable the Locations switch if the corresponding window is not shown.
  2. Within the Locations window, click the link in square brackets ("Hide" or "Reveal"). The current visibility status is shown in the Visibility column.

Hiding before publishing

You can also mark content as hidden before clicking the Send for publishing button in edit mode. You can only do this for the first version of an object. If you are about to edit a visible object that you want to make hidden, simply hide it before entering edit mode.

Hiding a node before publishing it is typically used for preventing the display of unfinished work; otherwise, the node is visible for at least a few seconds (before you can hide it) after it is published. It can also be used as a manual delayed publishing mechanism. Here, we use the term "manual" because you have to explicitly unhide the node later – you can also use the system's delayed publishing feature (described and explained in the eZ Publish Advanced Content Management book), which prevents the content from becoming published until a specified time.

In order for the "hide before publishing" feature to be available, the Locations window must be enabled for edit mode. You can toggle this in the Edit mode settings window on the left side of the My account tab.

Through the Locations window in edit mode, you can control where the object being edited should be published and how:

Locations window in edit mode

Once you have published an object (visible or invisible), it is part of the content node tree and thus you will be able to add sub-items to it. For example, you can publish an unfinished article as hidden, then create sub-pages for the article, and finally reveal the hidden article (and its sub-pages) when ready. This is handy since you cannot add sub-items to Draft objects (which do not yet have a location). The edit mode Locations window is disabled for all subsequent versions of the object.

36 542 Users on board!

Tutorial menu


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


Proudly Developed with from