Problem Statement:
How can I access component policies that were chosen at the template level to determine the visibility of specific fields within a component’s dialog?
Introduction:
AEM (Adobe Experience Manager) has integrated component policies as a central feature in the editable template system. This feature empowers both authors and developers to provide options for configuring the comprehensive behavior of fully featured components, including deciding which fields should be shown, hidden, or customized. This configuration can occur at the template level, allowing for reuse across various templates or template-specific customization.
Furthermore, AEM introduces a robust styling feature that empowers frontend developers to manage the visual appearance and user interface of components. This provides authors with the ability to configure the look and feel of components.
Let’s illustrate this with an example using one of AEM’s core components:
Requirement:
We want to prevent authors from editing the Pretitle field in the Teaser component.
Steps to Access the Policy:
Step 1: Navigate to a page in the WKND site via the Site Navigation. In our case, let’s open a magazine page.

Step 2: Access the Teaser component, where you will see the Pretitle field enabled.

Step 3: Now, go to the template editor to access the template structure.

Step 4: Click on the Teaser component’s policy.

Step 5: Select the checkbox to hide the Pretitle field.

Step 6: Return to the page, refresh it, and open the Teaser component. You’ll notice that you can enable or disable fields using the powerful policy feature.

Now, let’s explore how this works from a backend perspective by accessing CRXDE:
Step 1: In CRXDE, access your project structure to locate your Teaser component.
Path: /apps/wknd/components/teaser

You’ll notice that the component doesn’t have any content, as it overlays the core Teaser component.
Step 2: Navigate to the core Teaser component to access the design dialog (Policy-level fields).
Path: /apps/core/wcm/components/teaser/v2/teaser/cq:design_dialog/content/items/tabs/items/main/items/elements/items/pretitle

You can see that Policy-level fields are located under the design dialog, which can be used to modify the component dialog or behavior. The powerful aspect of policies is that you can have different policies for different templates.
Step 3: Go to the component dialog and examine the Pretitle fields.
Path: /apps/core/wcm/components/teaser/v2/teaser/cq:dialog/content/items/tabs/items/text/items/columns/items/column/items/pretitle

You’ll see that a property has been added to the component level using the OOTB (Out of the Box) Granite UI. This can be used for handling:
– FilteringResourceWrapper
– Render Condition
For more details, you can access these links for Granite UI and documentation.
However, to access any policy field at the component level, you can use the cqDesign implicit variable provided by ExpressionCustomizer by calling the property name as follows:
${cqDesign.[propertyname]} – general field name
For example: ${cqDesign.pretitleHidden} – pretitle field name










