Avoid getting duplicates in different slides when each slide is pulling random images from the same collection?

1 slider with with 4 slides each showing 5 random logos from a collection.

Problem
Multiple slides can contain/show the same logo-file since each slide pick at random from the same collection.

Question
How can I avoid this? Is there any way to only load unique logos onto each slide?

Thanks.

Hey Jon,

I would suggest not to choose randomly to avoid this issue altogether.
There probably is a way to rearrange the images with a different filter or styling.
If it needs to be random, you will most likely need some custom logic.

  • You could compare the item ID’s after fetching and sort duplicates out
  • Now you will be missing an img, how will you get an additional one?
  • You will end up fiddling with the CMS API, and it will not be fun

Just some thoughts :slight_smile:

Thanks for the input. I was hoping for a simple solution. :slight_smile:

I think my best option to have some control and get the random effect is to assign each logo with a number corresponding to a slide – and make it random within a slide.