One of the projects I’m working on has an ungodly amount of lead magnets, with different content for each lead magnet.
Each consists of:
- on-page CTA section (heading, text, image, button)
- popup: heading, text, form, with a hidden field on each form that is dynamically filled (it lets the CRM know which download to deliver).
I have been doing this with a custom post type and popups on query loops, but even this doesn’t quite have the flexibility I need. Sometimes the popup needs to be triggered by just a button, on the same page as other buttons.
Using query loops, I’d wind up with multiple instances of the popup template on the page, and it’s tricky to push the hidden value for the form, from a button outside the popup in this instance.
Ideally I’d rather just stack all the content for the popup in data-attributes on the button (title, text, form ID, hidden value) and have it dynamically update the popup data.
Anyone know if this is possible, or how to do it?
K