CMS Development

ChrisDavis
Member | Elite Partner
Member | Elite Partner

Modal with iFrame Gives HTTP Error 400 (Bad Request)

SOLVE

We are trying to help a client resolve a function of their existing site that HubSpot did not transfer over when migrating their site to HubSpot.

 

Their old site had a modal that opened and showed iFrame content within the opened modal. But HubSpot just set the links to open in a new tab. I was able to use Magnific Popup to handle the modal part and used a custom module to have a text field for entering the button text and a text field for dropping the iFrame URL in. The code snippet for the iFrame URL is where the src would go in the iFrame code.

 

I have tried just placing the iFrame URL instead of the code snippet, which kind of worked. The iFrame audio plays when you visit the page, but it should not. Then when you click the button, the iFrame is shown in the modal correctly.

 

So my problem, is what is causing the code snippet to mess up when it is in place?

 

Preview Link with the LAUNCH OUR VIDEO VIEWBOOK button at the bottom of the page.

0 Upvotes
1 Accepted solution
ChrisDavis
Solution
Member | Elite Partner
Member | Elite Partner

Modal with iFrame Gives HTTP Error 400 (Bad Request)

SOLVE

Just to give an update on this issue. I was able to narrow down the cause of the glitch to be that the text field added in the custom module is not handling the URL structure correctly and altering the URL structure enough that it can not reach the iFrame link.

View solution in original post

0 Upvotes
2 Replies 2
ChrisDavis
Solution
Member | Elite Partner
Member | Elite Partner

Modal with iFrame Gives HTTP Error 400 (Bad Request)

SOLVE

Just to give an update on this issue. I was able to narrow down the cause of the glitch to be that the text field added in the custom module is not handling the URL structure correctly and altering the URL structure enough that it can not reach the iFrame link.

0 Upvotes
jessebeginbound
Participant | Platinum Partner
Participant | Platinum Partner

Modal with iFrame Gives HTTP Error 400 (Bad Request)

SOLVE

Hi @ChrisDavis!

 

I know I'm a little late to reply here but just in case this helps anyone in the future, we have a custom module that allows you to trigger an iframe from a custom button very easily with no coding required. You can style the button and place it anywhere on any HubSpot CMS Template or page - no coding required. 

It's also worth mentioning that the module allows you to put a HubSpot Form, PDF, YouTube video, image or iframe into it! Whatever one you need! Check it out here if you're interested: http://beginbound.hs-sites.com/ultimate-popup-wizard-begin-bound-hubspot-custom-module