Hide and show conditions

Search
Feedback

Every node in the Page Tree can have show conditions which determine its visibility for the current user.

fig

Visibility Controlled By Locale

The visibility can be controlled by the locale (“Show for Locales” and “Hide for Locales” in the screenshot). Multiple locales can be entered as a comme-separated list.

Examples:

  • Show for Locales: en_US
    • This would show the node for the locale en_US
  • Hide for Locales: de_DE, de_AT, de_CH
    • This would hide the node for the locales de_DE, de_AT, de_CH

Visibility controlled by functions

Nodes can be shown and hidden by using “Show conditions” and “Hide conditions”. All built-in functions can be used to determine the visibility of the node though the main function should be a Boolean function.

Note: Even though we are using template expressions we do not use ${} because the complete expression is interpreted as a template expression.

Examples:

  • Show condition = and(not(empty(me)), equal(me.name, 'admin')
    • This code ensures that the node is only shown for logged in users whose name is admin
  • Hide condition = gt(12, 5)
    • Hides the node if 12 is greater than 5 which is always true and so the node is always hidden

Graph-Browser

About this article
Last change 2017-05-04
Topics FrontendStructr 2.0