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.
SOLVED

How to restrict components in a container having multiple parsys?

Avatar

Community Advisor

Hi Guys,

 

Say a container component has multiple parsys and the requirement here would be to use only some specific components to one of the parsys and the other parsys should allow all components.

sample example:

ManuMathew1994_0-1664621247469.png

 

Also is there a way to auto populate a default component on a parsys?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

This is possible as well, you need to create a cq:template and add editconfig to restrict add or remove those component



Arun Patidar

View solution in original post

7 Replies

Avatar

Community Advisor

you can do it by creating of proxy of parsys where you want to restrict component and create a policy for that with allowed component.



Arun Patidar

Avatar

Community Advisor

Thanks @arunpatidar, What about auto poplating the parsys with a default component? is that possible?

Avatar

Correct answer by
Community Advisor

This is possible as well, you need to create a cq:template and add editconfig to restrict add or remove those component



Arun Patidar

Avatar

Community Advisor

@Manu_Mathew_ 

Hope this is useful

Define a design xml for the page template which might look something like the below xml , (the below xml is basically mocking the node structure of the page.

 

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"xmlns:nt="http://www.jcp.org/jcr/nt/1.0xmlns:sling="http://sling.apache.org/jcr/sling/1.0xmlns:cq="http://www.day.com/jcr/cq/1.0jcrpimaryType="nt:unstructured">

<par jcrprimaryType="nt:unstructured"
   sling:resourceType="/libs/foundation/components/parsys"
   components="[project/general/components/<<restrictive-component>>]">

</par>

</jcr:root>

Avatar

Community Advisor

@Jagadeesh_Prakash should we define a separte copy of the template to achive this? Is this reffering to editable template?

Avatar

Community Advisor

@Manu_Mathew_  Yes it is refering to editable templates, This can be done a new template

Avatar

Employee Advisor

Have you tried setting up policies [1] for your parsys? Create one policy per parsys and in policy, you can configure a list of components that should be allowed for that parsys.

 

[1] https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/templates/page-tem...?