Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

AEM6.3 - List component with message on maximum of items

Avatar

Level 3

Hi,

I am using the "/apps/core/wcm/components/list/v1" component to have a list of pages.

On fixed list I have the button to add more content and I have as well the "Max items" option.

The max items option is used to show on page the maximum of items that I choose on this option.

I am trying to do a script to show a message or hide the add button when I already have the maximum of items, because the author could add many pages that it won't be displayed on the website.

How can I do this?

Thank you!

2 Replies

Avatar

Level 10

Have you tried extending this component and add a variable that  counts the items - when it reaches the max value - then execute your business logic.

Avatar

Level 4

@elizabethp6098148

There few things:

1. What is the use case for this? Even If we customize it and restrict Author to create more pages under that path because that will not be displayed on the page which has List (V1) component, Author may want to create more pages despite this limit

2. If the List (V1) component is used on more than 1 page for the same path with different Max number set, which number to be considered

3. If really want to restrict Author to create more than X number of page better we can set some property at Node level rather than considering this MaxNumber property from one/few particular pages.

Let me know your thoughts.