mhaywood720 Posted December 31, 2022 Share Posted December 31, 2022 Run into an interesting situation today and hopefully someone has some ideas on how to fix this. Have a page with iframe inside a code Block. Iframe just shows a 2nd page on the site. Site also has a Marketing Pop-Up running but not on these pages. Neither page is configure to show the popup and don't on their own. But, when the page shows in the iframe, the popup fires off. Anyone run into this before ? Link to comment
creedon Posted January 1 Share Posted January 1 Please post the URL for a page on your site where we can see your issue. A link to the backend of the your site won’t work for us, i.e. a url that contains /config/. Please set up a site-wide password, if your site is not public and you've not already done so. Post the password here. Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site. Please read the site-wide password and how to share a link documentation to understand how they work. We can then take a look at your issue. mhaywood720 1 Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
mhaywood720 Posted January 3 Author Share Posted January 3 My apologies, I should have included that in my original post: https://www.mtpleasant-tn.gov/kiosk I have included a screenshot showing I don't have either of these pages set to show the popup but it still happens. Link to comment
creedon Posted January 3 Share Posted January 3 (edited) The reason the pop-up is appearing is you're loading the landing page in through an iframe in a code block from the kiosk page. If you hit the landing page proper you'll notice that the pop-up doesn't pop. Edited January 3 by creedon Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
mhaywood720 Posted January 3 Author Share Posted January 3 19 minutes ago, creedon said: The reason the pop-up is appearing is you're loading the landing page in through an iframe in a code block from the kiosk page. If you hit the landing page proper you'll notice that the pop-up doesn't pop. Because it is a kiosk setup, I need to have that iframe to allow a way back to the main page. I am going to assume that any iframe causes the popup. Is there a way via code injection to block the popup? Link to comment
Solution creedon Posted January 3 Solution Share Posted January 3 (edited) Quote I am going to assume that any iframe causes the popup. I suspect this would be the case but I've not dug in to test it deeply. Add the following to Page Settings > Advanced > Page Header Code Injection for the Kiock page. Please see per-page code injection. <script> // promotional pop-up display stop let o = { version : 3 }; o = JSON.stringify ( o ); localStorage.setItem ( 'squarespace-popup-overlay', o ); </script> Note that this code will break when SS updates the version number of the squarespace-popup-overlay key. Let us know how it goes. Edited January 3 by creedon version 2 Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
mhaywood720 Posted January 3 Author Share Posted January 3 7 minutes ago, creedon said: I suspect this would be the case but I've not dug in to test it deeply. Add the following to Page Settings > Advanced > Page Header Code Injection for the Kiock page. Please see per-page code injection. <script> // promotional pop-up display stop const o = { version : 3 }; o = JSON.stringify ( o ); localStorage.setItem ( 'squarespace-popup-overlay', o ); </script> Note that this code will break when SS updates the version number of the squarespace-popup-overlay key. Let us know how it goes. I tried the above code but the popup still triggered. ?? I do appreciate the effort creedon Link to comment
creedon Posted January 3 Share Posted January 3 Quote I tried the above code but the popup still triggered. ?? I updated my code. I should have used a let instead of a const for the o variable. Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
mhaywood720 Posted January 4 Author Share Posted January 4 On 1/3/2023 at 2:56 PM, creedon said: I updated my code. I should have used a let instead of a const for the o variable. That worked @creedon! The popup no longer appears on the page. I sincerely appreciate the help on this issue! creedon 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment