Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Policies in AEM6.5

Avatar

Level 8
<image_policy
jcr:primaryType="nt:unstructured"
sling:resourceType="wcm/core/components/policy/policy"
jcr:title="Image"
allowUpload="false"
allowedRenditionWidths="[960,720,590]"
small="300x200"
cq:styleDefaultClasses="l-content-width">
<jcr:content jcr:primaryType="nt:unstructured"/>
<cq:styleGroups jcr:primaryType="nt:unstructured">
<item0 jcr:primaryType="nt:unstructured">
<cq:styles jcr:primaryType="nt:unstructured">
<item0
cq:styleClasses="l-content-width l-content-width--narrow"
cq:styleId="1603361754179"
cq:styleLabel="Small"
jcr:primaryType="nt:unstructured"/>
</cq:styles>
</item0>
</cq:styleGroups>
</image_policy>

Hi

I am trying to understand how will this policy apply the classes. This policy is used for the image component in an area. What are the different cq: styles refering to?

Also what is the variable currentStyle.offCanvasDivCss refering to in the template?

<div class="${currentStyle.offCanvasDivCss}" data-sly-unwrap="${!currentStyle.offCanvasDivCss}">

 

4 Replies

Avatar

Community Advisor

Hi @anasustic 

Here are the detailed documentation about policies  -

1. https://experienceleague.adobe.com/docs/experience-manager-64/forms/administrator-help/work-with-doc...
2. https://medium.com/adobetech/fantastic-aem-configurations-and-how-to-code-them-edb5663e983f

cq:style - https://experienceleague.adobe.com/docs/experience-manager-learn/sites/developing/style-system-techn...

currentStyle - Access design_dialog(currentStyle) properties.

Global content (that is, component values that are common across multiple instances of the same template) are stored as "styles" and edited via a "design dialog".

They are stored as follows:

/etc/designs/<design>/jcr:content/<template>/<component>

So, for the component logo in the template homepage, using the default design:

  • currentStyle is /etc/designs/default/jcr:content/homepage/logo


Hope this helps you!

Regards,
Santosh

Avatar

Level 8

Hi

Will the class

cq:styleDefaultClasses

be applied to any component of type Image in my case?

If I understand correctly the documentation is the 

cq:styleGroups

available for Editors when they want to style the image component themselves. Is that correct?