Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Restrict a component from being added to a parsys

Avatar

Level 2

Helo All,

I need to restrict a custom components being added to a parsys in 6.5x  something similar to "allowedParents" for templates.This component should only be allowed inside a container. Any suggestions would help.

 

Thanks and Regards

5 Replies

Avatar

Level 2

Thank u @SivakumarKanoori  , but unable to access the links mentioned in the answer of the abve url . is it broken ..?

 

Avatar

Community Advisor

Hi @krishker, For Editable templates, You need to use content policy.

Details: https://myaemlearnings.blogspot.com/2018/03/policies-in-editable-templates.html 

/conf/[project-name]/settings/wcm/templates/[template-name]/policies

<root jcr:primaryType="nt:unstructured"
  cq:policy="/policy_1553926688246"
  sling:resourceType="wcm/core/components/policies/mapping" />

 /conf/[project-name]/settings/wcm/policies

<policy_1553926688246 jcr:primaryType="nt:unstructured"
  jcr:title="Page Container Policy"
  sling:resourceType="wcm/core/components/policy/policy"
  components="[group:AEM Content,group:AEM Control]">
  <jcr:content jcr:primaryType="nt:unstructured"/>
</policy_1553926688246>