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

Content Policy for container inside Accordion Component

Avatar

Level 2

Hi,
I want to use the accordion component from core components but I don't want to nest it. The approach is that to create a policy that will not allow adding accordion to the accordion panels. I would like to add a possibility to add a container to the accordion panel but restrict this container to don't add an accordion component.
Is it possible to handle that case with a suitable policy for this nested component or there is the different method?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @mtobiasz 


You can configure the allowed components such as containers, text and so on.. through policy configuration for any core component.

On the page template component layout section you can select the accordion component and configure the policy.

The Allowed Components tab is used to define which components can be added as items to panels in the Accordion Component by the content author.

asutosh_j3_1-1618503953642.png

 

asutosh_j3_0-1618503883080.png

These configurations will be stored under /conf/project specific folder policy node.

asutosh_j3_0-1618504217794.png

 

After all configuration when you try to add component in accordion it will look something like below

 

asutosh_j3_2-1618504037502.png

 

 

More informaiton is avaialble here:

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/components/accordio...

 

Hope this helps!

Thanks!

View solution in original post

7 Replies

Avatar

Level 9

Hello,

If i understood your requirement. you can do it by extending it so that you can modify/apply the policy you want as default its associated to ".wcm-core" group.

now, once you categorized it to one of your component group (or even temporary you can modify the core only) then through template policy you can enable it and then in the same plz you can configure the allowed component (in design dialog) to only allow container component you want rather default. also, going forward you can setup policy for the container as well.

 

I hope it helps!!

Avatar

Level 2

Hi,

I would like that this policy would only apply to the container inside the accordion (in the scope of the accordion policy) but not to the container outside the accordion. Is possible?

Avatar

Correct answer by
Community Advisor

Hi @mtobiasz 


You can configure the allowed components such as containers, text and so on.. through policy configuration for any core component.

On the page template component layout section you can select the accordion component and configure the policy.

The Allowed Components tab is used to define which components can be added as items to panels in the Accordion Component by the content author.

asutosh_j3_1-1618503953642.png

 

asutosh_j3_0-1618503883080.png

These configurations will be stored under /conf/project specific folder policy node.

asutosh_j3_0-1618504217794.png

 

After all configuration when you try to add component in accordion it will look something like below

 

asutosh_j3_2-1618504037502.png

 

 

More informaiton is avaialble here:

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/components/accordio...

 

Hope this helps!

Thanks!

Avatar

Level 2

Hi @Asutosh_Jena_

Thanks for your response.
I'm aware of creating a policy for accordion so I can select only allowed components. But my question is related to using the policy for component one level down.
 - accordion_policy

 -- allowed components

 --- container 

 ---- allowed components

 ----- same components like in accordion allowed components list
Like in your example I would like to add the Container component as an item to the accordion but I would like to restrict this Container to allow only adding the same components as for the accordion component (In your example Button and Container). This restriction should work only in the scope of the accordion policy.

Avatar

Community Advisor

Hi @mtobiasz 

 

As per your requirement "I would like to restrict this Container to allow only adding the same components as for the accordion component (In your example Button and Container)" this is already working as you mentioned.

After adding another container into the accordion, it does not allow to add any other component except the allowed components into the container.

 

asutosh_j3_0-1618555955663.png

asutosh_j3_1-1618556026929.png

 

Thanks!

Avatar

Level 2

Hi @Asutosh_Jena_

Thanks for the update.

This was not working for my container like you described and now I know why
My custom container has a policy applied with allowed components which is wider than the policy created for accordion. It seems that when the component has its own policy then the accordion policy is not used.

I have created another container component dedicated to the accordion that doesn't have a policy with allowed components and now when inserting into an accordion it shows the same components as the accordion.