Expand my Community achievements bar.

How to restrict number of items that can be added in carousel?

Avatar

Level 2

I have created a proxy component that extends wcm/core/components/carousel/v1/carousel. I have restricted the allowed components. However now i want to restrict number of times we can add items,i.e, number of carousel cards.

how to achieve this?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Level 2

You can do this multiple ways, javascript, java... But i suggest that in the dialog definition (cq:dialog), add a validation rule to limit the number of items that can be added. Assuming you know how to overlay a component.

 

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/developing/pla...

 

Avatar

Level 4

Hi,

 

If you want to restrict the number of carousal fields in the component, you need to override dialog structure from core component.

 

You can keep all the created nodes empty and override just the no. of carousal fields and author it based on your requirement 

 

Hope this helps 

 

Thanks