Skip to the content
Documentation

Node visibility

No ratings yet

Hiding a node takes it, and everything below it, off the public site without removing anything. Editors still see and edit hidden content in the administration, and revealing the node brings the whole subtree back exactly as it was. Visibility belongs to a node, not to the object: an object with two locations can be hidden at one and visible at the other.

Hidden and invisible

Each node has two flags:

Flag Set when
Hidden (is_hidden) Someone hid this node itself.
Invisible (is_invisible) The node is hidden, or a node above it is hidden.

A node can therefore be invisible without being hidden. When its hidden ancestor is revealed, it becomes visible again, unless it was hidden itself, in which case it stays invisible together with its own subtree. Moving a node below a hidden node makes it invisible; moving it out makes it visible again, as long as it is not hidden itself.

Who sees what

Whether invisible nodes are shown depends on the siteaccess, site.ini [SiteAccessSettings] ShowHiddenNodes:

  • false (the default, for public siteaccesses): invisible nodes are left out of every fetch, menu and search result, and opening one directly answers with an access denied page.
  • true (the administration siteaccesses): they are shown, marked as hidden or hidden by a superior, so editors can work on them.

Visibility is not a permission. Someone who may not read a node does not see it whether it is hidden or not, and a hidden node is still readable through any siteaccess that shows hidden nodes. Use roles and policies or a section for content that must stay private.

Hiding and revealing

  • In the administration: the node's Hide / Reveal button, the Visibility choice in the right-click menu, or Hide selected in the sub-items list. Before hiding a node that other content links to, or whose object has further locations, a confirmation page lists them (content.ini [HideSettings] ReverseRelationCheck=warn).
  • When publishing with the Locations window: Visibility after publishing per location.
  • On a schedule: the cronjob hide.php hides content when a date attribute is reached, below the nodes of content.ini [HideSettings] RootNodeList[], for the classes and attributes in HideDateAttributeList[].
<?php /* #?ini charset="utf-8"?

[HideSettings]
RootNodeList[]
RootNodeList[]=2
HideDateAttributeList[]
HideDateAttributeList[article]=hide_date

*/ ?>

In templates

{if $node.is_invisible}(hidden){/if}

{* a fetch that includes invisible nodes, for example in an editor's view *}
{def $all = fetch( 'content', 'list', hash( 'parent_node_id', $node.node_id,
                                            'ignore_visibility', true() ) )}

In this section

Contributors

Comments (3 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Visibility of nodes related to hidden nodes

    Jostein Knudsen ·

    When you hide a node, you are not hiding its related nodes.
    Example:
    If you have embedded (related) an image in an article, and you hide the article, the image is still available to whoever knows the direct URL, for instance by searching for its description.

  2. setting visibility in the Admin Interface

    Kent Rauch ·

    The article states that users can set nodes to "hidden" but doesn't say how to do it. I'm looking all over in the Admin Interface and I can find no way to set visibility. I tried using "remove" and that made it go away permanently (as far as I can tell).
    Cookbook-style, please? Thanks.

    1. Re: setting visibility in the Admin Interface

      Yannick Peignard ·

      Hi,
      in the left menu of the admin interface, if you click (not a right click) on the name of an object, a new menu appears. Then, you have access to other functions for the menu. Il the advance option, you can hide an object.

Comments

Add a comment

Comments are read by a moderator before they appear.