Example
Examples of hide conditions can be found throughout AEM and the core components in particular. For example, consider the list core component as implemented in the WKND tutorial.
Using the template editor, the template author can define in the design dialog which options of the list component that are available to the page author. Such options as whether to allow the list to be a static list, a list of child pages, a list of tagged pages, and so on can be enabled or disabled.
If a template author chooses to disable the child pages option, a design property is set and a hide condition is evaluated against it, which causes the option to not render for the page author.
-
By default, the page author can use the list core component to build a list using child pages by choosing the option Child pages.
-
In the design dialog of the list core component, the template author can choose the option Disable Children to prevent the option to generate a list based on child pages from being shown to the page author.
-
A policy node is created under
/conf/wknd/settings/wcm/policies/wknd/components/listwith a propertydisableChildrenset totrue.
-
The hide condition is defined as the value of a
granite:hideproperty on the dialog property node/libs/core/wcm/components/list/v2/list/cq:dialog/content/items/tabs/items/listSettings/items/columns/items/column/items/listFrom/items/children
-
The value of
disableChildrenis pulled from the design configuration and the expression${cqDesign.disableChildren}evaluates tofalse, meaning the option will not be rendered as part of the component. -
The option Child pages is no longer rendered for the page author when using the list component.
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an event