Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Content Policy for container inside Accordion Component

Avatar

Avatar
Level 1
mtobiasz
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
mtobiasz
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
View profile
mtobiasz
Level 1

15-04-2021

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?

View Entire Topic

Avatar

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

403 likes

Total Posts

501 posts

Correct Reply

137 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile

Avatar
Affirm 100
Level 10
asutosh_jena
Level 10

Likes

403 likes

Total Posts

501 posts

Correct Reply

137 solutions
Top badges earned
Affirm 100
Ignite 1
Establish
Give Back 50
Give Back 5
View profile
asutosh_jena
Level 10

15-04-2021

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!

mtobiasz

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.

asutosh_jena

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!

mtobiasz

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.

asutosh_jena

Sounds good!