Our company is making flyers and banners with QR codes on them for hotels, and we want the QR codes to take the guest to a “workout of the day”. We want the page to change every day at midnight, and we want everyone who uses it to see the same page.
We have a CMS collection in Webflow called “workouts” (see image A). In each workout there is a switch field called “Hotel WOD” (see image B). That switch will be used to tell the code what workouts to pull from. We only want workouts with that switch “on” to be used in the code. We have also made a field called “order number” in case the code needs it to count/loop (See image C).
We will need some custom code to complete this operation.
I think the logic could look something like this:
QR code directs to “/hotelwod
Make redirect: “/hotelwod” that redirects to a page based on the following:
Get dynamic page from collection=workouts;
Only get pages that have “hotel-wod” switch on;
Start with “order-number”=1
Every night at midnight, previous order number +1!
When order number reaches the highest number, loop back to 1
Is this feasible? Do I need an additional database for a “count”