CMS Development

RoxannaBayram
Member

Random Image Rotation

SOLVE

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

0 Upvotes
1 Accepted solution
AJLaPorte_diagr
Solution
Key Advisor

Random Image Rotation

SOLVE

Hi Roxanna, 

 

You could build your member listing using HubDB (if you have it available: https://designers.hubspot.com/docs/tools/hubdb) and then make use of HubSpots random filter here: https://designers.hubspot.com/docs/hubl/hubl-supported-filters

 

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

 

View solution in original post

2 Replies 2
AJLaPorte_diagr
Solution
Key Advisor

Random Image Rotation

SOLVE

Hi Roxanna, 

 

You could build your member listing using HubDB (if you have it available: https://designers.hubspot.com/docs/tools/hubdb) and then make use of HubSpots random filter here: https://designers.hubspot.com/docs/hubl/hubl-supported-filters

 

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

 

John
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Random Image Rotation

SOLVE

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.



I like kudos almost as much as cake – a close second.

0 Upvotes