Carousel to show top destination | Community
Skip to main content
Level 2
Apr 28, 2022 5:35 PM UTC
Solved

Carousel to show top destination

Hi everyone

 

So, there is one requirement in which we have to show the top N number of destinations in the carousel and whenever a new destination is added to the top category it should automatically come on that carousel. How can we achieve that?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Himanshu_Jain
Himanshu_JainAccepted solution
New Participant
Apr 29, 2022 8:32 AM UTC

Add a custom property in dialog for example ranking and set the value as per your need.

And from that value you can decide which image need to be shown first in carousel.

Himanshu Jain

4 replies

Himanshu_Jain
Himanshu_JainAccepted solution
New Participant
Apr 29, 2022 8:32 AM UTC

Add a custom property in dialog for example ranking and set the value as per your need.

And from that value you can decide which image need to be shown first in carousel.

Translate
Himanshu Jain
VeenaVikraman
New Participant
Apr 29, 2022 2:10 AM UTC

@jangra98 How do you handle the top category ? What decides a destination is a top category ? Do you set any property ? 

Translate
Jangra98Author
Level 2
Apr 30, 2022 6:30 AM UTC

by just simply adding a tag to it. the main problem I have is how to iterate image and link in the carousel. 

Translate
Ravi_Pampana
New Participant
Apr 28, 2022 7:01 PM UTC

Hi,

 

In java (sling model) you can use Collections.reverse after adding the carousel item nodes to collection which will display the last node on top

Translate