How can i get images to automatically display in carousel component that are unique to the page/content beneath?

Avatar

Avatar

kevinc55336069

Avatar

kevinc55336069

kevinc55336069

15-05-2019

I have created a custom carousel component that sits on the top of each page of my site (shared component) and allows the author to manually pick 5 images from DAM assets to be displayed in the carousel. I now want to have images displayed in the carousel that are unique to each individual page and it's content (lots of images on every page). I want these 5 pictures to be the 5 most recent article assets, as the content and pictures are updated every month. Could someone point me in the right direction on how to do this or provide any similar examples?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

15-05-2019

you need to get image dynamically(based on your business case) from DAM using Java logic in your components and do rest like carousel behaviour.

for example you can create DOM dynamically from the latest image from fetched from JAVA code and show/hide one by one using javascript.

Answers (1)

Answers (1)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

15-05-2019

This would require custom JavaScript  logic. I am not aware of any AEM Examples of this.