Skip to main content
VeenaVikraman
Community Advisor
Community Advisor
September 4, 2024
Beantwortet

AEM | How to restrict components on responsive grid added inside another component ?

  • September 4, 2024
  • 2 Antworten
  • 815 Ansichten

Hi Team

 

    We are currently working on developing a column control component with two columns and two containers. We need to restrict certain components to the first column cotainer and a different set of components to the second container. However, We can set policies only on container component and it gets applied to every container. Is there a way we can achieve this?

 

Thanks

Veena

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von arunpatidar

Hi @veenavikraman 

You can assign different policies to the column components only if each column is a separate component. You could create proxy components for each column to apply different policies.

Then, you can directly set the desired policies to those individual column components.

 

If you need to set different policy for a component differently if used another component then you can use something like below.

For example, if I want different policy for a parsys within tabs component then I can use something like below:

 

<tabs cq:policy="myproj/components/content/tabs/policy_tabs_1" jcr:primaryType="nt:unstructured" sling:resourceType="wcm/core/components/policies/mapping"> <wcm jcr:primaryType="nt:unstructured"> <foundation jcr:primaryType="nt:unstructured"> <components jcr:primaryType="nt:unstructured"> <parsys cq:policy="myproj/components/content/tabs/policy_tabs-parsys" jcr:primaryType="nt:unstructured" sling:resourceType="wcm/core/components/policies/mapping" /> </components> </foundation> </wcm> </tabs>

. 

2 Antworten

narendiran_ravi
Level 6
September 4, 2024

Can you try creating a new container proxy component and setting policies for it? I think it is worth trying this workaround if we don't find any viable solution.

arunpatidar
Community Advisor
Community Advisor
September 4, 2024

Hi @veenavikraman 

You can assign different policies to the column components only if each column is a separate component. You could create proxy components for each column to apply different policies.

Then, you can directly set the desired policies to those individual column components.

 

If you need to set different policy for a component differently if used another component then you can use something like below.

For example, if I want different policy for a parsys within tabs component then I can use something like below:

 

<tabs cq:policy="myproj/components/content/tabs/policy_tabs_1" jcr:primaryType="nt:unstructured" sling:resourceType="wcm/core/components/policies/mapping"> <wcm jcr:primaryType="nt:unstructured"> <foundation jcr:primaryType="nt:unstructured"> <components jcr:primaryType="nt:unstructured"> <parsys cq:policy="myproj/components/content/tabs/policy_tabs-parsys" jcr:primaryType="nt:unstructured" sling:resourceType="wcm/core/components/policies/mapping" /> </components> </foundation> </wcm> </tabs>

. 

Arun Patidar