Elementor is a free WordPress plugin that enhances your website to allow graphical drag and drop editing of websites and it's free.
It is full of nice and helpful snippets with an especially powerful one being the ability add in Popups. This can give your website focus areas and direct flows in a slick manner and it works as long as you stay within the confines of hooking this snippet up to this defined enhancement etc, but as soon as you try to do something a little bit off the prescribed flow things get painful and hard to do.
First the popup system seems to always inject a dynamic script element as a directive from Elementor. Now this probably is a good decision as if you dropped a html tag or script code it would need to load the contents or perform the action to ensure it shows even if a popup is destroyed from the Document Object Model (DOM)
However if you are embedding third party content (in this case an iframe and yes I know iframes are passe, but they still allow for mix and matching content embedded and shared by link like the original World Wide Web was intended) it will render the contents and inject the script each time except the script here that loads the iframe is intended to be run once on the webpage so this causes multiple iframes to load and render in the popup. Note that the task here was that 2 separate iframes are loading into the same popup from different sources (strange occurrence, but what was desired)
What is the solution?
- Load the widget script with a onetime page load check
- Create a general elementor popup that contains a left div and right div (1 div each to hold the each separate iframes content)
And it works finally