Expand my Community achievements bar.

SOLVED

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

Avatar

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

Avatar

Correct answer by
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.



Arun Patidar

View solution in original post

2 Replies

Avatar

Level 10

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

Avatar

Correct answer by
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.



Arun Patidar