Random Image Rotation

Hi HS Community,

Would appreciate any support on this!

We are trying to have a random image rotation feature on our team page, which links to individual team member photos. Rather than having the whole team showing, we wanted to be able to only view three team members but for them to randomly generate when the page loads each time.

Has anyone tried this in HS, or had any success with importing their code from elsewhere?

Thank you in advance for the time taking to read this and/or reply.

Roxanna

Hi Roxanna,

You could build your member listing using HubDB (if you have it available: HubDB - HubSpot docs) and then make use of HubSpots random filter here: Accounts Dashboard | HubSpot

This would allow you to pull 3 random entries from the DB to display. It’s also a better use case for using HubDB with any kind of directory listing as its less work than having to create a grouped module for each “card” for an employee.

Hope this helps point you in the right direction.

-AJ

In my experience with the random filter, it pulls random data, but it does not do it on each query. So, the same “random” data shows every time the page is loaded. Does this happen to anyone else?

I have tried this with testimonials.