Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Default new policy is getting applied to the image component policy

Avatar

Level 1

There is a problem with the component policy. The policy for the image component is not being applied correctly.

 

VarunKanchi_0-1689935749836.png

 

.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @VarunKanchi, You need to connect your wcm/policies with the template policies. 

You can check the following example:
/conf/aem-demo/settings/wcm/templates/[template]/policies/.content.xml

<aem-demo jcr:primaryType="nt:unstructured">
  <components jcr:primaryType="nt:unstructured">
    <image jcr:primaryType="nt:unstructured" 
      <!-- Your Policy here -->
      cq:policy="aem-demo/components/content/image/v1/image/policy" 
      sling:resourceType="wcm/core/components/policies/mapping"/>
  </components>
</aem-demo>

 

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @VarunKanchi, You need to connect your wcm/policies with the template policies. 

You can check the following example:
/conf/aem-demo/settings/wcm/templates/[template]/policies/.content.xml

<aem-demo jcr:primaryType="nt:unstructured">
  <components jcr:primaryType="nt:unstructured">
    <image jcr:primaryType="nt:unstructured" 
      <!-- Your Policy here -->
      cq:policy="aem-demo/components/content/image/v1/image/policy" 
      sling:resourceType="wcm/core/components/policies/mapping"/>
  </components>
</aem-demo>

 

 

Avatar

Level 6

From your screenshot I can see that you have created a image policy named Content Image. All you need to do is just map it with the image component.

Follow the path and pattern in this screenshot where I am defining the policy.

and after it I will map it to different types of templates

kaikubad_0-1690222740811.png

This is the mapping on home page template

kaikubad_1-1690223047259.png