How to restrict components in a container having multiple parsys? | Community
Skip to main content
Manu_Mathew_
Community Advisor
Community Advisor
October 1, 2022
Solved

How to restrict components in a container having multiple parsys?

  • October 1, 2022
  • 3 replies
  • 1699 views

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:

 

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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

3 replies

arunpatidar
Community Advisor
Community Advisor
October 1, 2022

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
Manu_Mathew_
Community Advisor
Community Advisor
October 1, 2022

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

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
October 2, 2022

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

Arun Patidar
Jagadeesh_Prakash
Community Advisor
Community Advisor
October 2, 2022

@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>

Manu_Mathew_
Community Advisor
Community Advisor
October 2, 2022

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

Jagadeesh_Prakash
Community Advisor
Community Advisor
October 3, 2022

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

Mohit_KBansal
Adobe Employee
Adobe Employee
October 3, 2022

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-templates-editable.html?