Example

Examples of hide conditions can be found throughout AEM and the core components in particular. For example, consider the list core component.

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.

  1. By default, the page author can use the list core component to build a list using child pages by choosing the option Child pages.

    chlimage_1-218

  2. 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.

    chlimage_1-219

  3. A policy node is created under /conf/we-retail/settings/wcm/policies/weretail/components/content/list with a property disableChildren set to true.

  4. The hide condition is defined as the value of a granite:hide property on the dialog property node /conf/we-retail/settings/wcm/policies/weretail/components/content/list

    chlimage_1-220

  5. The value of disableChildren is pulled from the design configuration and the expression ${cqDesign.disableChildren} evaluates to false, meaning the option will not be rendered as part of the component.

    You can view the hide expression as the value of the granite:hide property in GitHub.

  6. The option Child pages is no longer rendered for the page author when using the list component.

    chlimage_1-221

Experience Manager


Driving Marketing Agility and Scale: Transforming your Content Supply Chain with AI

Online | Strategy Keynote | General Audience

Marketers everywhere are feeling the pressure to deliver impactful campaigns faster and at greater scale. This Strategy Keynote explores...

Tue, Mar 18, 2:30 PM PDT (9:30 PM UTC)

Register

Put the Customer at the Center and Build Relationships That Last a Lifetime

Online | Strategy Keynote | General Audience

First impressions last a lifetime. Great first impressions feel personal, connected, and relevant right from the start. From the first...

Wed, Mar 19, 2:30 PM PDT (9:30 PM UTC)

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more