Archived topic
Need to trigger modal pop-up with GB button click
5 replies · Started by Sasha on November 7, 2022
Hello,
I have some HTML code provided by ConvertKit which I need to link to a GB button in order to trigger a modal pop-up.
I've currently got a workaround in place wherein the button click loads an identical page with a modal that pops up in 0 seconds, but obviously that's not a great solution.
Thanks for any help you can provide!
Hi Sasha,
The Trigger modal HTML has a link, which you can directly copy and paste to a GB Button link input box.
As for the data-formkit-toggle if you have GenerateBlocks Pro, you can add it through the Block Settings in the Advanced section. Reference: https://docs.generateblocks.com/article/custom-attributes/
Thanks Fernando! I do have GenerateBlocks Pro... But forgive me, how should I enter the data-formkit-toggle value? Is is a "custom attribute"?
Ideally the modal would open on-page (as it does on the page I just dropped in the private info section), versus redirecting to the modal's external instance.
Yes, it's a custom attribute which you can add in the Advanced Settings of the Block. Just click on Add Attribute.
Can you share the complete HTML code provided? For reference, some pop-up links need such a structure: https://superdevresources.com/open-links-popup/#:~:text=HTML%20%2B%20JavaScript%20code%20for%20Popup
Let us know.
Thank you! Everything seems to be working now that I entered in the attribute info.
The complete HTML code was shared in my first post, but I did also need to use the ConvertKit plugin to "place" the modal on the page so it could pop up upon link click :)
I see. Glad it's working now! You're welcome Sasha! :)