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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

kevinc55336069
Level 2
Level 2

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

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

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.

View solution in original post

2 Replies
smacdonald2008
Level 10
Level 10

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

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

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.

View solution in original post