how to restrict allowed components in policy properties aem for editable template | Community
Skip to main content
Level 2
August 4, 2020
Solved

how to restrict allowed components in policy properties aem for editable template

  • August 4, 2020
  • 2 replies
  • 4115 views

one of our requirement is see if we can make changes to the layout policy properties, where we can restrict the allowed components that gets displayed for selection.

 

i.e. we want only our project component group to be displayed there instead of the whole groups (ex: General, ACS Commons .. e.t.c) that are available for selection as shown below.

 

 

 

 

 

 @smacdonald2008 @joerghoh @kautuk_sahni @arunpatidar @briankasingli @theo_pendle 

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

Hi,

/libs/cq/gui/components/authoring/allowedcomponents/AllowedComponents.java is responsible to fetch all the components and shows in the allowed component part.

You can overlay /libs/cq/gui/components/authoring/allowedcomponents/allowedcomponents.html and add data-sly-test for ACS Common component groups

 

 

<coral-search placeholder="${'Search' @ i18n}" class="js-cq-AllowedComponents-filter cq-AllowedComponents-filter"></coral-search> <coral-accordion variant="quiet" class="cq-AllowedComponents js-cq-AllowedComponents"> <!--/* render component groups */--> <sly data-sly-use.api="libs.cq.gui.components.authoring.allowedcomponents.AllowedComponents" data-sly-repeat.group="${api.groups}"> <sly data-sly-test=${group.title!='ACS Commons'} data-sly-use.template="componentgroup.html" data-sly-call="${template.componentGroup @ group=group}"/> </sly> </coral-accordion>

 

 

 

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 4, 2020

Hi,

/libs/cq/gui/components/authoring/allowedcomponents/AllowedComponents.java is responsible to fetch all the components and shows in the allowed component part.

You can overlay /libs/cq/gui/components/authoring/allowedcomponents/allowedcomponents.html and add data-sly-test for ACS Common component groups

 

 

<coral-search placeholder="${'Search' @ i18n}" class="js-cq-AllowedComponents-filter cq-AllowedComponents-filter"></coral-search> <coral-accordion variant="quiet" class="cq-AllowedComponents js-cq-AllowedComponents"> <!--/* render component groups */--> <sly data-sly-use.api="libs.cq.gui.components.authoring.allowedcomponents.AllowedComponents" data-sly-repeat.group="${api.groups}"> <sly data-sly-test=${group.title!='ACS Commons'} data-sly-use.template="componentgroup.html" data-sly-call="${template.componentGroup @ group=group}"/> </sly> </coral-accordion>

 

 

 

Arun Patidar
AEM_65Author
Level 2
August 4, 2020

Hi Arun,

Thanks for the reply, But here I dont want any of those groups.

I only need my project group. thats it.

 

Is there a way to restrict to show only my project group for component selection?

 

@arunpatidar 

 

arunpatidar
Community Advisor
Community Advisor
August 10, 2020

is this resolved? Let me know if you still looking for solution.

I created a custom allowed type with Generic approach. I will share the complete solution.

 

 

Arun Patidar
arunpatidar
Community Advisor
Community Advisor
November 22, 2024