I’m trying to replicate Webflow’s now native conditional visibility based on whether a CMS item is set or not using custom code. The reason being is that I’m displaying a specific CMS item using cookies so I need to have all the information in a Custom HTML embed, and I need to be able to send this “field is set or not” information as a cookie as well.
Essentially I am trying to figure out this sequence:
- User clicks on a custom coded HTML button on a CMS item which creates cookie information from CMS item fields (I already have this part taken care of and working fine)
- Also need to send information as a cookie on whether or not a specific field of a CMS item is set (this is what I’m trying to figure out)
- Take that “set or not field” cookie and use it to either hide or show an element. (I can figure that out fine)
Here’s my preview. The custom code is in the top navbar.
Thanks a lot!