I’m currently running a website for a small business that is opening up new locations.
I need to show different contact info for each different location. The contact info is present on multiple pages, so I think the best solution would be to use a cookie (to persist the location). The element is the same across all pages, all the data is non-null (e.g. phone number, email address, contact name) strings.
My initial idea was to have a location select dropdown that would set cookies, and then I would show elements based on the data set (using Bricks Conditions). However, I ran into problems; it seems “Browser Storage: Add” doesn’t work and no cookie gets added (tested using nav link and button elements).
Then, I tried making a .php formula that gets called by an echo
dynamic data to call a “setcookie()” function. That gets called twice per button on page load, and also doesn’t actually set a cookie.
To finally top it off, I realized a few minutes ago that Browser Storage is actually not one of the usable conditions in the Conditions page, so my original plan of having a ton of duplicated elements with slightly different info that gets conditionally shown can’t happen.
Showing data conditionally, based on a cookie seems like something people would regularly use, so I’m curious if anyone has experience or knows how to do this. I’m wondering if this is something that would require me to ssh into my hosting provider in order to touch the code directly.