Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

IFrame on multiple WP installs
https://www.tinywebgallery.com/forum/viewtopic.php?f=21&t=4172
Page 1 of 1

Author:  rchan454 [ 11. Nov 2016, 19:16 ]
Post subject:  IFrame on multiple WP installs

First I explain the problem: If you have one WordPress installation your need to include the ai_external.js to the page in the iframe. If you now want to show this page in another WordPress installation you also need to include the ai_external.js from there. This means you have now 2 ai_external.js in your remote page. This is actually not a problem but has the following restriction: ai_external.js can be configured by variables you define before the script. And once the first ai_external.js is loaded, the variables are defined. This means that all ai_external.js files have the same configuration! The difference is the url where e.g. the height is sent to. Also only the css changes from the first ai_external.js are used and all scripts send with the same id. This means on all shortcodes you have to use the same id!

This scenario works fine if you e.g. want to hide the same elements and use auto height. The small drawback is that the scripts not used currently send requests which don't do anything.

This is not working for me, it only works for the 1st line in the code.
<script src="http://gibsonsflooring.com/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>
<script src="http://carpetsplus.in/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>
I have 100 websites, do I need to add 100 of these?

Author:  TinyWebGallery [ 12. Nov 2016, 02:19 ]
Post subject:  Re: IFrame on multiple WP installs

No - you can switch the communication to postMessage. Check the external workaround tab. In the pro version also there is a multisite switch. then a * is used that means that the domain of the message is not checked.
then you only need to include one ai_external.js if all have the same config. In 7.3 there is also a config switcher in the js folder where you could specify special configurations depending on a parameter. see js/ai_config_switcher_template.js.

Best,
Michael

Author:  rchan454 [ 14. Nov 2016, 18:38 ]
Post subject:  Re: IFrame on multiple WP installs

thanks for your reply :D

I am having trouble figuring out where to include the ai_external.js.. (((then you only need to include one ai_external.js if all have the same config.)))
I did this: ...(((you can switch the communication to postMessage. Check the external workaround tab. In the pro version also there is a multisite switch. then a * is used that means that the domain of the message is not checked.)))

I just want to add one iFrame to many different websites with different domain names and have auto-height work.

Author:  TinyWebGallery [ 14. Nov 2016, 21:36 ]
Post subject:  Re: IFrame on multiple WP installs

Include it to the page in the iframe. Optimal before the </body> so a footer.php works fine.

Have you found the 2 settings on the advanced tab?

Here you find the examples for post message:
http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/external-workaround-with-post-message

+
var domainMultisite = true;
in your case

But if you enable this is in the administration it is much easier.

Best, Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/