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

Avatar

Avatar

AEM_65

Avatar

AEM_65

AEM_65

04-08-2020

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.

 

 

 

Screen Shot 2020-08-04 at 12.52.16 PM.png

 

 

 @smacdonald2008 @Jörg_Hoh @kautuk_sahni @Arun_Patidar @BrianKasingli @Theo_Pendle 

AEM aem6.5 Editable templates Layout policy

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

958

Correct Answer

820

Avatar

Arun_Patidar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

958

Correct Answer

820
Arun_Patidar
MVP

04-08-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>

 

 

 

Answers (1)

Answers (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

958

Correct Answer

820

Avatar

Arun_Patidar

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

958

Correct Answer

820
Arun_Patidar
MVP

10-08-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_0-1597076738167.png