Advanced iFrame Pro v2020 (Your installation is up to date - view history)
If you start using advanced iframe please read the quickstart guide on the options tab first. After that continue with an iframe like described on the basic tab. Only if the iframe appears add additional features. Go to the free and the pro demos page for running examples.
 


No settings found for this search term.
 
The search does look for the search term in the label and the description of each setting on all tabs. Tabs with findings are marked yellow. It does not search in the additional documentation that does exist in each section. Please use the browser search for a full text of this page.


Basic settings

Please use the following shortcode to add an iframe to your page:
[advanced_iframe] or use the "Add advanced iframe" button above the editor.
Specify at least an url and the size. You can overwrite all of the default administration settings by specifying the attribute in the shortcode to create iframes with different settings!

You can also generate a shortcode which does include all settings as shortcode attributes. This shortcode does not use any of the defaults.

Copy the following shortcode to your page:

[advanced_iframe]

Examples if you want to use several iframes with different settings. Also read the FAQ:

  • [advanced_iframe src="http://www.tinywebgallery.com"]
  • [advanced_iframe src="http://www.tinywebgallery.com" width="100%" height="600"]
  • [advanced_iframe src="http://www.tinywebgallery.com" id="iframe1" name="iframe1" width="100%" height="600" ]
  • [advanced_iframe id="iframe1" name="iframe1" width="100%" height="600"]http://www.tinywebgallery.com[/advanced_iframe]

Security key

This is the security key which can be used in the shorttag. This is optional since version 7.5.4. If you set this only users who know the security key can insert an advanced iframe. Also they need to have the minimum user role defined in the options to access a page with an advenced iframe. The key was made optional because many user have not the need of a security key and without the configuration is easier. Because of compability reasons security key in a shortcode are ignoered if you don't define a key here! Shortcode attribute: securitykey=""

UrlShow a working example

Enter the full URL to your page. e.g. http://www.tinywebgallery.com. Please do not use a different protocol for the iframe: Do not mix http and https if possible! Http pages are NOT shown in https pages. Please read this post for details. If you cannot save the full url because of mod_security don't specify the protocoll (e.g. //www.tinywebgallery.com) or leave this field empty and define the src in the shortcode. Also use the free url checker below to make sure that you can include the page. You can also add parameters to this url like http://www.tinywebgallery.com/test.php?iframe=true. Then you can check this variable and use it to e.g. hide some elements in the iframe.
The pro version also has some placeholders (the standalone version has only host and port available) which are replaced on the fly: {site}: the url to the wordpress root{host}: the current host from the request{port}: the current port from the request{userid [,defaultvalue]}: the id of the current user. The optional defaultvalue is used if no user is logged in.{username [,defaultvalue]}: the username of the current user. The optional defaultvalue is used if no user is logged in.{useremail [,defaultvalue]}: the e-mail of the current user. The optional defaultvalue is used if no user is logged in.{adminmail}: the e-mail of the wordpress admin{userinfo-X [,defaultvalue]}: extract attribute X from get_currentuserinfo. E.g. {userinfo-display_name}. The optional defaultvalue is used if the attribute is not found or set. See here for details. Click here for all values of the current user ID => 1
user_login => admin
user_pass => $P$B7sO6PKoToFuRWz8CD0Z55kj6ZX32q/
user_nicename => admin
user_email => michi@mdempfle.de
user_url => http://www.tinywebgallery.com
user_registered => 2009-04-15 07:58:38
user_activation_key =>
user_status => 0
display_name => TinyWebGallery
{usermeta-X [,defaultvalue]}: extract key X from get_user_meta. E.g. {usermeta-last_name}. The optional defaultvalue is used if the attribute is not found or set. See here for details. Click here for all values of the current user.nickname => TinyWebGallery
rich_editing => true
comment_shortcuts => false
admin_color => fresh
wp_capabilities => a:1:{s:13:"administrator";b:1;}
wp_user_level => 10
wp_usersettings => m0=o&m1=o&m2=c&m3=c&m4=o&m5=o&m6=c&m7=c&m8=c&mfold=o&m9=o&hidetb=1&editor=tinymce&align=center&imgsize=medium&urlbutton=urlfile&m10=c&uploader=1
wp_usersettingstime => 1357632269
wp_autosave_draft_ids => a:164:{i:-1239783216;i:3;i:-1239784425;i:5;i:-1239802013;i:10;i:-1240263863;i:18;i:-1240425709;i:21;i:-1240426361;i:22;i:-1240518001;i:25;i:-1241088869;i:33;i:-1241114450;i:36;i:-1241267320;i:37;i:-1241379617;i:40;i:-1241639342;i:43;i:-1241715645;i:46;i:-1242083329;i:49;i:-1242246489;i:58;i:-1242377113;i:60;i:-1242588360;i:62;i:-1243629227;i:66;i:-1243771837;i:69;i:-1244107829;i:73;i:-1244280297;i:76;i:-1244281575;i:79;i:-1244371210;i:91;i:-1244372330;i:114;i:-1244792716;i:119;i:-1244982290;i:127;i:-1245010221;i:129;i:-1245606751;i:134;i:-1245852945;i:136;i:-1246189062;i:159;i:-1246191186;i:161;i:-1246192248;i:169;i:-1246404621;i:179;i:-1246482675;i:186;i:-1248177304;i:193;i:-1249327463;i:199;i:-1249845209;i:202;i:-1250278541;i:204;i:-1250837732;i:206;i:-1251559659;i:208;i:-1251571558;i:210;i:-1251746409;i:212;i:-1251842530;i:215;i:-1252706000;i:217;i:-1252749478;i:222;i:-1253355269;i:224;i:-1253356039;i:230;i:-1253601357;i:233;i:-1253775191;i:235;i:-1253831587;i:239;i:-1253913220;i:242;i:-1253992960;i:246;i:-1254314600;i:248;i:-1254403268;i:250;i:-1255095113;i:252;i:-1255293219;i:254;i:-1255377990;i:256;i:-1255979537;i:261;i:-1256387449;i:263;i:-1256498688;i:265;i:-1256664656;i:273;i:-1256665509;i:276;i:-1257974361;i:279;i:-1259606607;i:281;i:-1260317229;i:284;i:-1260394683;i:286;i:-1261094647;i:296;i:-1261308642;i:298;i:-1261309508;i:306;i:-1262538081;i:309;i:-1263060377;i:314;i:-1263145734;i:316;i:-1263550499;i:319;i:-1263564531;i:321;i:-1264204622;i:326;i:-1264546045;i:328;i:-1265322422;i:330;i:-1265414409;i:335;i:-1265802577;i:337;i:-1265833216;i:340;i:-1266425973;i:346;i:-1268308657;i:348;i:-1268778079;i:352;i:-1269030520;i:354;i:-1270564984;i:356;i:-1270568604;i:360;i:-1271199342;i:366;i:-1271605699;i:369;i:-1272835584;i:372;i:-1272879792;i:374;i:-1272915503;i:376;i:-1272916097;i:381;i:-1273089342;i:387;i:-1277587607;i:390;i:-1278247101;i:392;i:-1278626407;i:395;i:-1278839560;i:397;i:-1279368496;i:401;i:-1280008147;i:406;i:-1280047388;i:408;i:-1281217152;i:411;i:-1281384388;i:415;i:-1282943456;i:417;i:-1284556231;i:419;i:-1285138310;i:421;i:-1285161005;i:423;i:-1285323063;i:426;i:-1285878083;i:430;i:-1286739294;i:433;i:-1290430300;i:436;i:-1290945387;i:441;i:-1292068083;i:446;i:-1295854411;i:455;i:-1298328874;i:464;i:-1299280405;i:469;i:-1300054099;i:471;i:-1301007366;i:476;i:-1301008688;i:478;i:-1301009197;i:481;i:-1301009586;i:483;i:-1301151236;i:486;i:-1301174009;i:490;i:-1301776125;i:493;i:-1301776303;i:495;i:-1301826923;i:497;i:-1301945348;i:499;i:-1302437947;i:511;i:-1302899716;i:515;i:-1307392993;i:517;i:-1308308080;i:520;i:-1309985224;i:523;i:-1310592327;i:525;i:-1311344375;i:529;i:-1311344438;i:532;i:-1311792672;i:537;i:-1312465860;i:539;i:-1312902187;i:549;i:-1313091299;i:558;i:-1316035219;i:584;i:-1319400875;i:588;i:-1319658739;i:590;i:-1322083751;i:597;i:-1327870366;i:608;i:-1328991647;i:610;i:-1328996023;i:613;i:-1331928042;i:619;i:-1334306858;i:629;i:-1338406581;i:633;i:-1338634506;i:635;i:-1341432979;i:639;i:-1344424940;i:642;i:-1345578722;i:646;i:-1346449861;i:648;i:-1349949056;i:652;i:-1350508076;i:670;i:-1351888502;i:672;i:-1351971838;i:675;i:-1357595761;i:677;i:-1358613055;i:684;i:-1360228391;i:690;i:-1360618313;i:694;i:-1360788186;i:696;i:-1362233648;i:700;i:-1362949975;i:703;}
closedpostboxes_post => a:1:{i:0;s:0:"";}
metaboxhidden_post => a:2:{i:0;s:7:"slugdiv";i:1;s:29:"wp_statistics_editor_meta_box";}
closedpostboxes_page => a:1:{i:0;s:12:"revisionsdiv";}
metaboxhidden_page => a:1:{i:0;s:29:"wp_statistics_editor_meta_box";}
edit_comments_per_page => 100
wp_user-settings => editor=tinymce
wp_user-settings-time => 1539554481
wp_dashboard_quick_press_last_post_id => 3488
dismissed_wp_pointers => wp330_toolbar,wp340_customize_current_theme_link,wp350_media,aioseop_welcome,aioseop_donate,aioseop_menu_202,aioseop_welcome_202,aioseop_menu_203,aioseop_welcome_203,aioseop_menu_211,wp360_revisions,wp390_widgets,aioseop_welcome_211,aioseop_menu_220,wp410_dfw,aioseop_welcome_220,theme_editor_notice,plugin_editor_notice,wp496_privacy
managenav-menuscolumnshidden => a:4:{i:0;s:11:"link-target";i:1;s:11:"css-classes";i:2;s:3:"xfn";i:3;s:11:"description";}
metaboxhidden_nav-menus => a:3:{i:0;s:8:"add-post";i:1;s:12:"add-post_tag";i:2;s:15:"add-post_format";}
meta-box-order_page => a:3:{s:4:"side";s:161:"contentonly,yasr_metabox_overall_rating,social_meta_broadcast,submitdiv,pageparentdiv,rawhtml_meta_box,theme-layouts-post-meta-box,postimagediv,ep_admin_meta_box";s:6:"normal";s:110:"postcustom,commentstatusdiv,slugdiv,authordiv,revisionsdiv,postexcerpt,commentsdiv,social_meta_aggregation_log";s:8:"advanced";s:5:"aiosp";}
screen_layout_page => 2
closedpostboxes_dashboard => a:0:{}
metaboxhidden_dashboard => a:13:{i:0;s:21:"dashboard_browser_nag";i:1;s:29:"wp-statistics-browsers-widget";i:2;s:30:"wp-statistics-countries-widget";i:3;s:28:"wp-statistics-hitsmap-widget";i:4;s:25:"wp-statistics-hits-widget";i:5;s:26:"wp-statistics-pages-widget";i:6;s:27:"wp-statistics-recent-widget";i:7;s:30:"wp-statistics-referring-widget";i:8;s:27:"wp-statistics-search-widget";i:9;s:28:"wp-statistics-summary-widget";i:10;s:26:"wp-statistics-words-widget";i:11;s:33:"wp-statistics-top-visitors-widget";i:12;s:37:"wp-statistics-searched-phrases-widget";}
social_accounts =>
first_name =>
last_name =>
description =>
use_ssl => 0
show_admin_bar_front => true
aim =>
yim =>
jabber =>
googleplus =>
nav_menu_recently_edited => 135
community-events-location => a:1:{s:2:"ip";s:11:"93.104.77.0";}
social_suppress_enable_notice => true
session_tokens => a:3:{s:64:"65ec9e1272d198ebf3f4cfdc60adee84e1856597c2d164329c2cf05cdbfe84da";a:4:{s:10:"expiration";i:1539072285;s:2:"ip";s:13:"93.104.93.159";s:2:"ua";s:72:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0";s:5:"login";i:1538899485;}s:64:"5f5aee445bdfde6b7c9e2784ca416d014530ede3e04ef28e1c9c3c541766c05a";a:4:{s:10:"expiration";i:1539202379;s:2:"ip";s:13:"93.104.74.241";s:2:"ua";s:72:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0";s:5:"login";i:1539029579;}s:64:"40872f14846b88f82cc8cbdffbe1534b6409f7be0ffa67c1fcee4fb1f32e9a03";a:4:{s:10:"expiration";i:1540240956;s:2:"ip";s:13:"93.104.74.241";s:2:"ua";s:72:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0";s:5:"login";i:1539031356;}}
wp_statistics => a:2:{s:13:"dashboard_set";s:6:"12.3.1";s:10:"editor_set";s:6:"12.3.1";}
show_welcome_panel => 0
show_try_gutenberg_panel => 0
{href}: The full url that is shown in the address bar{urlpathX}: the Xth path element from the front. The first path element would be {urlpath1}<{urlpath-X}: the Xth path element from behind. The last path element would be {urlpath-1}{query-X [,defaultvalue]}: the value of the query parameter sent by GET or POST. ?example=myvalue would be {query-example} -> myvalue. The optional defaultvalue is used if the parameter is not found.{timestamp}: a timestamp which can be used to avoid caching of iframes{session_id}: the current session id if one is available. Othwise a empty string.
Make sure that no spaces are in the placeholders.
All placeholders except {site}, {host}, {port} are urlencoded! An example would be src="http://demo.{host}/url?id={userid}". Especially for multidomain installations this is maybe helpful. If no user is logged in the values are empty or 0 for the id.
urlpath does extract path elements from the url in the address bar. So {urlpath-1} for the url www.xx.com/a/bb/cc would be cc. All placeholders that cannot be resolved are removed.
Also shortcodes are supported. You have to replace the bracket [ with {{ and ] with }}. So if the shortcode is [link] you have to use {{link}} because shortcode attributes which include shortcodes are not supported directly by Wordpress. Also be aware of single and double quotations: src="http://demo.{{url domain='home'}}/url". So only use ' for attributes of the nested shortcode.
BBCode: If you have special characters e.g. [] in the url you need to use the bbcode style for the url: [advanced_iframe]url[/advanced_iframe].
PDF support: If you include a pdf google doc is used to render the pdf. This solution looks the same on all browsers. If you want to use the native pdf renderer of the browser/your system add NATIVE: before the url. Like NATIVE:http://www.example.com/pdf.pdf.
Shortcode attribute: src=""

Free url checker Not all pages can be included in an iframe because they have a header flag this does not allow this. The free iframe checker is already included now in the administration. The Free iframe checker page has a 2nd step where you also can see if iframe killer scripts are running!
Width

The width of the iframe. You can specify the value in px or in %. If you don't specify anything px is assumed. Pro user can also do basic calculations here if you have e.g. a fix left navigation on a page. e.g. 100%-200px. Also vw is now supported. vw is viewport width. This is more important for the height with vh! See http://caniuse.com/#feat=calc for supported browsers! Shortcode attribute: width=""

Height

The height of the iframe. You can specify the value in px or in %. If you don't specify anything px is assumed. Please note that % does most of the time does NOT give the expected result (e.g. 100% is only 150px) because the % are not from the iframe page but from the parent element. If you like that the iframe is resized to the content please go to 'Resize the iframe to the content height/width' if you are one hte same domain or the "External workaround" if the iframe is on a diffent domain. Also vh is now supported! e.g. 100vh means 100% of the viewport height. This is the "fullscreen" many users look after. This is now supported by all major browsers. See here. Pro user can also do basic calculations here if you have e.g. a fix header or footer on a page. e.g. 100%-200px. See http://caniuse.com/#feat=calc for supported browsers! Shortcode attribute: height=""

Scrolling Yes     No     Not rendered

Defines if scrollbars are shown if the page is too big for your iframe. Please note: If you select 'Yes' IE does always show scrollbars on many pages! So only use this if needed. Scrolling "none" means that the attribute is not rendered at all and can be set by css to enable the scrollbars responsive. Shortcode attribute: scrolling="auto" or scrolling="no" or scrolling="none"

Enable scrolling on ipad and iphone Show a working example Yes     No

Currently mobile ios devices like ipad and iphone do not support scrolling inside an iframe properly. This changes from version to version. By enabling this parameter an additional div with additional ios css styles is wrapped around the iframe which does the scrolling. This feature is currently supported for simple iframes, show iframe as layer and show only a part of an iframe when scrolling is enabled. Please test this feature with all the ios devices you want to support! This feature does use the internal browser detection. So the additional div is only rendered for mobile ios devices! Zoom is currenly only supported in the "show only a part of the iframe" mode! For all features where auto height is enabled the additional div is also not rendered as there no scrolling does exist. Currently the default is set to false. As soon as many users also report that this is working on many devices the default will be set to true. So please report if this features does/doesn't work for you! Shortcode attribute: enable_ios_mobile_scolling="true" or enable_ios_mobile_scolling="false"

Margin width

The margin width of the iframe. You can specify the value in px. If you don't specify anything px is assumed. Shortcode attribute: marginwidth=""

Margin height

The margin height of the iframe. You can specify the value in px. If you don't specify anything px is assumed. Shortcode attribute: marginheight=""

Frame border

The frame border of the iframe. You can specify the value in px. If you don't specify anything px is assumed. Shortcode attribute: frameborder=""

Transparency Yes     No

If you like that the iframe is transparent and your background is shown you should set this to 'Yes'. If this value is not set then the iframe is transparent in IE but transparent in e.g. Firefox. So by default you should leave this to 'Yes'. Shortcode attribute: transparency="true" or transparency="false"

Class

You can define a class for the iframe if you like. Shortcode attribute: class=""

Style

You can define styles for the iframe if you like. The recommended way is to put the styles in a css file and use the class option. With the button below the width, height, content_id, content_styles, hide_content_until_iframe_color and the needed styles above for a fullscreen iframe are set. Also check the settings at the height where you can do calculations to add fixed headers/footers. Shortcode attribute: style=""

Id

Enter the 'id' attribute of the iframe. Allowed values are only a-zA-Z0-9_. Ids cannot start with a number!!! Do NOT use any other characters because the id is also used to generate unique javascript functions! Other characters will be removed when you save! If a src directly in a shortcode is set and no id than an id is generated automatically if several iframes are on one page to avoid configuration problems. Shortcode attribute: id=""

Name

Enter the 'name' attribute of the iframe. Shortcode attribute: name=""

Allow full screen Yes     No

allowfullscreen is an HTML attribute that enables videos to be displayed in fullscreen mode. Currently this is a new html attribute not supported by all browsers. So please check all of the browsers you want to support. Shortcode attribute: allowfullscreen="true" or allowfullscreen="false"

Sandbox

Enter the 'sandbox' attribute of the iframe. See w3c or w3schools for details. To render sandbox without a value for all restrictions please enter "sandbox". Shortcode attribute: sandbox=""

Title

The html title attribute of an iframe. Shortcode attribute: title=""

Allow

Since April 2018 the autoplay functionality of Chrome has changed. To still be able to play videos with sound in an iframe you need to set allow="autoplay" to the iframe. Please read the linked article for details. Shortcode attribute: allow=""

Please open the section where you want to change a default setting. Please note that some of the advanced features require basic html/css knowhow! You can open several sections at once for easier navigation.

Advanced features


Advanced features

The following options are already features which are not html standard anymore. All the options do already require additional Javascript, css or dynamic processing.

Scrolls the parent window/iframe to the top Yes     Iframe     False

If you like that if you click on a link in the iframe the parent page should scroll to the top of the whole page you should set this to 'Yes'. Please note that this is done by Javascript! So if a user has Javascript deactivated no scrolling is done. This setting generates the code onload="aiScrollToTop("id","true");" to the iframe. If you select the resize iframe as well then onload="aiResizeIframe(this);aiScrollToTop("your_id","true");" is generated. If you like a different order please enter the javascript functions directly in the onload parameter in the order you like. You can also scroll to the top of the iframe by selecting 'Iframe'. Then this setting generates the code onload="aiScrollToTop("your_id","iframe");". Shortcode attribute: onload_scroll_top="true", onload_scroll_top="iframe" or onload_scroll_top="false"

Hide the iframe until it is loaded Yes     No

This setting hides the iframe until it is loaded. This prevents the iframe white flash issue while loading and also if you modify the iframe only the final result is visible. Since 7.5.6. this also works for following pages in the iframe as the iframe is hidden again when the url changes. When you use the external workaround please check the setting for the "External workaround". The setting there overwrites this setting because otherwise the iframe is maybe shown too early! Shortcode attribute: hide_page_until_loaded="true" or hide_page_until_loaded="false"

Show loading iconShow a working example Yes     No

You can show a loading icon until the page in the iframe is fully loaded. You can use your own image with the size of 66 x 66 px by replacing the file img/loader.gif. Shortcode attribute: show_iframe_loader="true" or show_iframe_loader="false"

Hide the content until iframe is loaded

If you define a color here (e.g. #ffffff) the content of the main page is hidden until the iframe is loaded. Especially if the iframe does cover most of your page the iframe looks more integrated. If you use fullscreen iframes sometimes it is better to keep this additional layer as the fullscreen iframe is on top of this. Add |keep to your color then. E.g. #ffffff|keep. Shortcode attribute: hide_content_until_iframe_color=""

Enable responsive iframeShow a working example Yes     No

You can enable that the width of iframe is responsive. This features adds a max-width:100% to the iframe. So the defined width is the maximum width of the iframe. If the surrounding element gets smaller than this, the iframe is responsive and does shrink! When you enable this feature AND also the resize the iframe to the content height (direct or by external workaround), the height does get responsive too! And this is the big difference to any other pure css solution which only work for iframes with a certain ratio e.g. for videos. Please read this post for details and take a look pro demo. Please note that this feature does NOT work together with "Show only a part of an iframe" and "Hidden tabs". Shortcode attribute: enable_responsive_iframe="true" or enable_responsive_iframe="false"

Set Iframe height by ratioShow a working example

This setting enables you to set the height of an iframe depending on the width of an iframe with a given ratio. If you have a static site you know the width of an iframe and you can set the height to a fix value. But if you e.g. have an iframe width of 100% and responsive layout you do not know the height. Using auto height does solve this most of the time but sometimes the content inside the iframe is fully dynamic too (like a video which does scale). If this is the case you can define a ratio here. e.g. 0.5 means that if you have a width of 1000 you have a height of 500. If the width changes to 800 the height changes to 400. Please use a . as decimal char. This setting does also work together with "Enable responsive iframe". Scalling the browser does change the height also if you enable the setting above. If you enable this setting the local resize settings are disabled! Shortcode attribute: iframe_height_ratio=""

Reload interval

You can reload the iframe in a given interval. Enter the intervall im ms or leave the field blank for no reload. Shortcode attribute: reload_interval=""

Safari cookie fix

If you need cookies in the page in the iframe to work properly you have a problem with Safari because Safari blocks 3rd party cookies by default! Therefore such pages will not work in iframes in Safari and browsers that are configured the same way. Please read about the problem and the basic solution here: http://vitr.github.io/safari-cookie-in-iframe/. the solution in this plugin has even more features like full browser and message support. Please go my example pages for the different options and how you can configure this. Shortcode attribute: safari_fix_url=""

Browser detection You can specify browser specific iframes. This is imporant especially for the "Show only part of the iframe" feature where browser differences of a few pixels can matter. But you can use this for other things as well because mobile, iphone, ipad can also be detected. Please read the browser detection section for details. Shortcode: browser=""

Resize the iframe to the content height/width


Resize the iframe to the content height/width

Options if the iframe is on the same domain

PLEASE READ THIS FIRST:

Only if the content from the iframe comes from the same domain it is possible that the onload attribute can execute Javascript directly which does e.g. resize the iframe to the height of the content or scroll the parent window to the top.
If this is the case you can use the settings below. If you want to include an iframe from a different domain please go to the "External workaround" where I explain how this can be done if you can modify the web site that should be included. So if you are on a different domain and cannot edit the external iframe page no interaction between parent and iframe is possible!

Please note: The resize implementation for the same domain is the same for the pro and the free version. But the external workaround of the PRO version has additional options like you can define the element to measure and it has some additional tricks that the measurements do work. So if you have problems with the auto height on the same domain try the external workaround with including ai_external.js!
Resize iframe to content height Yes     No

If you like that the iframe is resized to the height of the content you should set this to 'Yes'. Please note that this is done by Javascript! So if a user has Javascript deactivated the iframe does not get resized. Please set the default height of the iframe to the minimum pixels the iframe should have! In the shortcode you can also specify resize_min_height="". By default this is set to 1. The content is resized to this given minimum. Sometimes this does not work properly. Try bigger values then. If this still does not wok please look at some of the pro features like "Auto zoom iframe with a fix ratio" or "Responsive videos". This setting generates the code onload="aiResizeIframe(this);" to the iframe. Shortcode attribute: onload_resize="true" or onload_resize="false"

Resize delay

Sometimes the external page does not have its full height after loading because e.g. parts of the page are build by Javascript. If this is the case you can define a timeout in millisecounds until the resize is called. Otherwise leave this field empty.. Shortcode attribute: onload_resize_delay=""

Store height in cookie Yes     No

If you enable the dynamic resize the value is calculated each time when the page is loaded. So each time it took a little time until the resize of the iframe is done. And this is visible sometimes if the content page loads very slow or is on a different domain or depends on the browser. By enabling this option the last calculated height is stored in a cookie and available right away. The iframe is then first resized to this height and later on when the new height comes it is updated. By default this is disabled because when you have dynamic content in the iframe it is possible that the iframe does not shrink. So please try this setting with your destination page. If you use several iframes on one page please don't use this because currently only one cookie per page is supported. Also you cannot use this feature if you include the ai.js file at the bottom. If you use iframe on different pages different id are needed because the id is part of the cookie.. Shortcode attribute: store_height_in_cookie="true" or store_height_in_cookie="false"

Additional height

If you like that the iframe is higher than the calculated value you can add some extra height here. This number is then added to the calculated one. This is e.g. needed if one of your tested browsers displays a scrollbar because of 1 or 2 pixel. Or you have an invisible area that is shown by the click on a button that can increase the size of the page. This option is NOT possible when "Store height in cookie" is enabled because this would cause that the height will increase at each reload of the parent page. If you use several iframes please use the same setting for all of them because there is only one global variable. Shortcode attribute: additional_height=""

Resize iframe to content width Yes     No

If you like that the iframe is resized to the width of the content you should set this to 'Yes'. PLEASE NOTE: Normally this is NOT what you want. Most people like a width of 100%! If you have a responsive layout this setting should be false. If your iframe has only a width of 1px disable the feature! Please note that this is done by Javascript and only in combination with resizing the content height! So if a user has Javascript deactivated or a not supported browser the iframe does not get resized. This setting generates the code onload="aiResizeIframe(this, 'true');" to the iframe. Shortcode attribute: onload_resize_width="true" or onload_resize_width="false"

Resize on click events

If you like that the iframe is resized after clicks in the iframe please enter the timeout here. Otherwise leave this field empty. The number is the timeout in milliseconds until the resize is called. This setting intercepts the clicks on the element specified below. Catching happens BEFORE the actual action on e.g. the link. Therefore you need to enter a number > 0 because the original action is done later. 100 is a good value to start with! If you have e.g. a slide down effect you should add the time here it takes to get the full height. This setting does only work on the SAME domain by default. If you like to get this working across different domains use the "Resize on Element resize" feature of the pro version. Shortcode attribute: resize_on_click=""

Elements where the clicks are intercepted

You can define the tags and ids where the clicks should be intercepted. By default all links "a" are intercepted. To define a specific id you have to add the id with a :. So intercepting all links with the id "testid" you have to enter "a:testid". The id you specify is compared with "contains". So if you use "a:test" all links with an id containing test are intercepted. You can add several tags separated by ",". So "a:test,button:submitid" would work fine. Always try to specify the elements as exactly as possible to avoid any problems with other Javascript on the site. If you leave this field empty resize on click events is NOT enabled at all! Shortcode attribute: resize_on_click_elements=""

Resize on AJAX events

If you like that the iframe is resized after each AJAX event in the iframe please enter a number here. Otherwise leave this field empty. The number is the timeout in milliseconds until the resize is called. This setting intercepts the AJAX call after the callback was executed. So for many pages 0 should work fine. But if you have e.g. a slide down effect you should add the time here to get the full height. Currently only jQuery and direct XMLHttpRequest are supported as AJAX calls on the included page! See the "AJAX events are jQuery" setting. This setting does only work on the SAME domain by default. If you like to get this working across different domains use the "Resize on Element resize" feature of the pro version. Shortcode attribute: resize_on_ajax=""

AJAX events are jQuery Yes     No

Currently only direct XMLHttpRequest and jQuery AJAX call can be intercepted. Please select true = jQuery, false = XMLHttpRequest. Shortcode attribute: resize_on_ajax_jquery="true" or resize_on_ajax_jquery="false"

Resize on element resizeShow a working example

With this setting you are able to detect if the size of an element changes. If this is the case than the iframe is resized. This can be on click, by an Ajax call, typing with the keyboard where a menu opens, a timer .... So actually any change of the size. The big advantage is that this feature is most of the time easier to configure than the options before and also more powerful. But it has the disadvantage that the change of the size is not send by an event but the defined elements are checked in a fix interval (see below). So e.g. every 100ms a certain div is checked and if the size has changed the iframe is resized.
If you only specify "body" then the iframe does enlarge nicely but does not get smaller anymore. Therefore you should not use this! The best way to configure this is to use the outermost element where the change can happen. Please see example 26 for a working example. This feature does also trigger all css/js modifications inside the iframe again! You can use the jQuery syntax to specify the elements. Most likely the outermost div (e.g. #main, #page, #wrap) is the one you need. This feature is also available in the external workaround while "Resize on click events" and "Resize on AJAX events" not yet! Shortcode attribute: resize_on_element_resize=""

Poll interval for the resize detectionShow a working example

The invervall in ms the specified element is checked for a change of the size. The minimum polling time is 50ms. If you a smaller value the default of 250 is used. Shortcode attribute: resize_on_element_resize_delay=""

Onload

Enter the 'onload' script of the iframe you want to execute. You can enter Javascript that is executed when the iframe is loaded. Please check the settings before first! There you find a solution for iframe resize. Please note that the output is escaped for security reasons with the Wordpress function esc_js. So please define your Javascript functions in your parent page, read all needed parameters inside the functions and call this function here. I recommend to use only the following characters: a-zA-Z_0-9();. Also note that the 2 settings below also use the onload event. So if you set them to true the code is appended to your onload function. If you like a different order of the predefined functions (aiShowElementOnly(id,element); aiResizeIframe(this); and aiScrollToTop();) please set the settings below to 'No' and enter them here directly. Shortcode attribute: onload=""

Resize hidden iframes on tabs

Elements that are hidden with display:none return a size of 0 when the height is measured. This is very often the case when tabs are used and you place an iframe on a tab that is not shown by default. The next settings are needed for a workaround that moves the hidden element out of the viewport, shows and measures the iframe and moves everything back. To get this working you need to provide the id or class of the tab that is hidden and depending on the tabs plugin also the id or class of the tab that is visible by default to get the correct width. Please read the section "How to find the id and the attributes" to find the right id or class. E.g. Tabby Responsive Tabs and Post UI Tabs work fine with this solution. Even nested tabs do work! If you need a custom solution please contact me for an offer.

IMPORTANT: If you use this feature with the external workaround you NEED to set a resize delay because otherwise the height is measured while the element is still hidden. This can be done by setting "var onload_resize_delay = 200;" before the external workaround script. Depending on the size of your page you might have to increase this value. As the tab is hidden this should not be a problem. For details please see the "External workaround".

Please note: Check the lazy load feature! It does also support hidden tabs and is maybe the better solution as you only load the iframe when it is really visible.

Please note: This feature is not supported for responsive iframes because the size of the hidden tabs are not calculated at each resize.

Hidden tab(s) with iframe

The id or class of the tab that is hidden. You need to define the element that has display:none set. E.g. For "Tabby Responsive Tabs" this would be #tablist1-panel2 if the iframe is on the 2nd tab. For "Post UI Tabs" it would be #tabs-1-2. If you have nested hidden elements all elements need to be defined here. You need to specify each hidden element starting from the outermost. e.g. #tablist1-panel2,#tabs-1-2 if you use "Tabby Responsive Tabs" and inside the tabs "Post UI Tabs. Shortcode attribute: tab_hidden=""

Visible tab

The id or class of the tab that is visible by default. This is needed to preserve the width of the first hidden tab. Depending on your css this is not needed but e.g. for "Tabby Responsive Tabs" you would need #tablist1-panel1 in the default setup. If you have defined several elements at "Hidden tab(s) with iframe" you need to specify the element that has the same width as the hidden element you have defined first above. Shortcode attribute: tab_visible=""

Show only a part of the iframe


Show only a part of the iframe

You can only show a part of the iframe. This solution DOES WORK across domains without any hacks! This is a solution that works only with css by placing a window over the iframe which does a clipping. All areas of the iframe that are not inside the window cannot be seen. Please specify the upper left corner coordinates x and y and the height and width that should be shown. Specify a fixed height and width in the iframe options at the top for optimal results! I recommend to make the iframe itself that big that no scrollbars do exist anymore. Otherwise scrolling e.g. with the mouse wheel on some browsers is possible. Simply select the area you want to show with the graphical area selector! You can even zoom the selected area that it fits properly e.g. on a mobile phone. Please go to the pro demo for some working examples. Please also check the additional 5 options. These are the advanced features to handle changes in the iframe.

Also media queries are supported! This enables you to show different areas depending on the browser width. Please see example 55 for a working demo.

Show me an image how the settings are used.

Show only part of the iframeShow a working example Yes     No

Show only part of the iframe. You have to enable this to use all the options below. Please read the text above. Shortcode attribute: show_part_of_iframe="true" or show_part_of_iframe="false"

Upper left corner x

Specifies the x coordinate of the upper left corner of the view window. Enter the x-offset from the left border of your external iframe page you want to show. Shortcode attribute: show_part_of_iframe_x="". Show me an image how this settings is used.

Upper left corner y (top distance)

Specifies the y coordinate of the upper left corner. Enter the y-offset from the top border of your external iframe page you want to show. Shortcode attribute: show_part_of_iframe_y="". Show me an image how this settings is used.

Width of the visible content

Specifies the width of the content in pixel that should be shown. Shortcode attribute: show_part_of_iframe_width="". Show me an image how this settings is used.

Height of the visible content

Specifies the height of the content in pixel that should be shown. Shortcode attribute: show_part_of_iframe_height="". Show me an image how this settings is used.

Enable horizontal scrollbar Yes     No

By default you specify a fixed area you want to show from the external page. Settings this to "true" will show a horizontal scrollbar if needed. Shortcode attribute: show_part_of_iframe_allow_scrollbar_horizontal="true" or show_part_of_iframe_allow_scrollbar_horizontal="false". Show me an image how this settings is used.

Enable vertical scrollbar Yes     No

By default you specify a fixed area you want to show from the external page. Settings this to "true" will show a vertical scrollbar if needed. Shortcode attribute: show_part_of_iframe_allow_scrollbar_vertical="true" or show_part_of_iframe_allow_scrollbar_vertical="false". Show me an image how this settings is used.

Viewport style

Show part of an iframe does create an additional div which is the element you can style here. If you e.g. want to add a border you can add css here directly. e.g. use "border: 2px solid #ff0000;". Using the style, border or class in the default settings do not work as they are all related to the iframe directly! If you also using zoom or features like "Hide a part of the iframe" or the iframe loader AND you want to center the iframe you need the "old" <center>[advanced-iframe ....]</center> If you want to apply styles to other elements that are added dynamically please use the options on "Modify the parent page". Shortcode attribute: show_part_of_iframe_style=""

Enable auto zoomShow a working example Yes     No     Full

This zoom setting enables you to zoom the viewport automatically to the available space. The difference to the normal zoom options is that the whole selected area is zoomed and not the content of the iframe only. This zoom works like the "Auto zoom by ratio" but you don't have to specify a ratio as the height and the width is already known from the settings above. This feature does check the size of the div around the viewport and calculates the needed zoom factor and offsets. Therefore you have to select a fixed viewport (e.g. width:500) because otherwise the calculated zoom would always be 1. If you select "Yes" the zoom does only shrink the viewport which is normally the best choice because looks good on desktop and is shown smaller on mobile devices. If you select "Full" the viewport is also enlaged. Also the feature "Hide/cover parts of the iframe" is supported. So if you place e.g. a colored div over a certain area to hide it it is also zoomed Shortcode attribute: show_part_of_iframe_zoom="true", show_part_of_iframe_zoom="false" or show_part_of_iframe_zoom="full"

With the following 5 options you can do something when the page in the iframe does change. The parent page does only know the url of the iframe that is loaded initially. This is a browser restriction when the pages are not on the same domain. The parent only can find out when the page inside does change. But it does not know to which url. So the options below rely on a counting of the onload event. But for certain solutions (e.g. show only the login part of a page and then open the result page as parent) this will work.

Change the viewport when iframe changes to the next step

You can define different viewports when the page inside the iframe does change and a onload event is fired. Each time this event is fired a different viewport is shown. A viewport is defined the following way: left,top,width,height e.g. 50,100,500,600. You can define several viewports (if you e.g. have a straigt workflow) by separating the viewports by ; e.g. 50,100,500,600;10,40,200,400. Each viewport has its own class: ai-viewport-X. X is the number of the viewport starting with 0! You can e.g. enable scroll for specific viewports with this setting. Shortcode attribute: show_part_of_iframe_next_viewports=""

Restart the viewports from the beginning after the last step. Yes     No

If you define different viewports it could make sense always to use them in a loop. E.g. if you have an image gallery where you have an overview with viewport 1 and a detail page with viewport 2. And you can only can come from the overview to the detail page and back. Shortcode attribute: show_part_of_iframe_next_viewports_loop="true" or show_part_of_iframe_next_viewports_loop="false"

Open iFrame in new window after the last step

You can define if the iframe is opened in a new tab/window or as full window. the options you can use are "_top" = as full window, "_blank" = new tab/window or you leave it blank to stay in the iframe. Because of the browser restriction not the current url of the iframe can be loaded. It is either the initial one or the one you specify in the next setting. Shortcode attribute: show_part_of_iframe_new_window="", show_part_of_iframe_new_window="_top" or show_part_of_iframe_new_window="_blank"

Url that is opened after the last step

You can define the url that is loaded after the last step. This enables you to jump to a certain page after your workflow. This is useful with the above. Shortcode attribute: show_part_of_iframe_new_url=""

Hide the iframe after the last step Yes     No

Hides the iframe after the last step completely. Shortcode attribute: show_part_of_iframe_next_viewports_hide="true" or show_part_of_iframe_next_viewports_hide="false"

Hide/cover parts of the iframe.


Hide/cover parts of the iframe.

Please note: This is an advanced setting! You need to know basic html/css to use all possibilities of this feature! You can define an area which will be hidden by a rectangle you define. This can e.g. be used to hide a logo.

Hide/cover parts of the iframe. Make an iframe read onlyShow a working example

A rectangle is defined the following way: left,top,width,height,color,z-index e.g. 10,20,200,50,#ffffff,10. This defines a rectangle in white with the z-index of 10. z-index means the layer the rectangle is placed. If you don't see your rectangle please use a higher z-index. You can also define a background image here! use e.g. 10,20,200,50,#ffffff;background-image:url(your-logo.gif);background-repeat:no-repeat;,10 for a white rectangle with the given background image. Use the area selector to get the coordinates very easy. You can specify several rectangles by separating them by |. Please see the pro demo for a cool example where a logo is exchanged.

You can also create read only iframes with this feature. Use hide_part_of_iframe="0,0,100%,100%,transparent,10". For a working example please see example 21 of the pro demo.

It is also possible to define an optional link and an optional target for this area. Parameter 7 is the url and parameter 8 the target. So a working example would be: hide_part_of_iframe="0,0,100%,100%,transparent,10,http://www.tinywebgallery.com,_blank".

The divs can also be right and bottom aligned. You need to specify the prefix r for right instead of left and b for bottom instead of top. An example would look like this: r10,b20,200,50,#ffffff,10.

Also media queries are supported! This enables you to hides areas depending on the browser width. Please see example 50 for a working demo.

The div does also support the usage of an external html files even with shortcodes. Below you see the existing external files, how to use them and you can also create/edit/delete them.

Also you can hide the divs by click or hide them after a given time of ms. Add $hide or $hideXXXX where XXXX is the time in ms. So $hide3000 hides the div after 3 seconds. You can add this like an additional file or even together with it. e.g. #ffffff$hide or #ffffff$file$hide3000 is possible. For this feature it also makes sense to use semi transpartent backrounds. rgba is therefore supported now. The only thing which is important is that , needs to replaced by §. So rgba(1§1§1§0.5) has to be used here.

Shortcode attribute: hide_part_of_iframe=""

Existing external div files

You can show a custom html inside the div you create. This makes it possible to show whatever you like over the other iframe. Also shortcodes are supported in the external file. You can use this file if you attach the id of the file to the style settings seperated by a $. So 10,20,200,50,#ffffff$123,10 has to be used if your id is 123 (file name = hide_123.html)

The following external div files in the folder "advanced-iframe-custom" currently exist. Please note that you can view/edit this files with the plugin editor of Wordpress by clicking on the "Edit/View" link.


hide_123.html   Edit/View   Remove


Create a custom external div file. Only specify the id. All files are named "hide_{id}.html":

Modify the iframe


Modify the iframe

Modify the content of the iframe if the iframe page is on the same domain or if you can use the external workaround.

With the following options you can modify the content of the iframe. IMPORTANT: This is only possible if the iframe comes from the same domain because of the same origin policy of Javascript.

If you can use the "External workaround", you can also use this setting in the pro version.

Please read the section "How to find the id and the attributes" above how to find the right styles. If the content comes from a different domain you have to modify the iframe page by e.g. adding a Javascript function that is then called by the onload function you can set above or you add a parameter in the url that you can read in the iframe and display the page differently then. You should also use the external workaround to modify the iframe if your page loads quite slow and you see the modifications on subsequent pages. The reason is that the direct modification can only be done after the page is loaded and the "Hide until loaded" is only working for the 1st page. The external workaround is able to hide the iframe until it is modified always and also css can be added to the header directly.

Add css class to iframe elements Yes     No

Sometimes it is not possible to modify existing css classes in the iframe because they are also used somewhere else or there is no unique selector for this element. Also it is sometimes needed that each iframe page do need a different unique selector. Setting this attribute to true causes that in the iframe an unique is created from the iframe url and is added as class to the body and his children. Then you are also able to e.g. hide a element on one page and show it on another page. Shortcode attribute: add_css_class_iframe="true" or add_css_class_iframe="false"

Hide elements in iframeShow a working example

This setting allows you to hide elements inside the iframe. This can be used to hide e.g. a div or a heading. Usage: If you want to hide a div you have to enter a hash (#) followed by the id e.g. #header. If you want to hide a heading which is a <h2> you have to enter h2. You can define several elements separated by , e.g. #header,h2. I recommend using firebug to find the elements and the ids. You can use any valid jQuery selector pattern here! Also the width and height of the elements are set to 0 because e.g. auto height or auto zoom could have problems measuring! Shortcode attribute: iframe_hide_elements=""

Show only one elementShow a working example

You can define which part of the page should be shown in the iframe. You can define the id (e.g. #id) or the class (.class) which should be shown. Be aware that all other elements below the body are removed! So if your css relies on a certain structure you have to add additional css by "Content id in iframe" below. Very often also a background is defined for the header which you should remove below. e.g. by setting background-image: none; in the body. This can be done at "Content id in iframe" and "Content styles in iframe" below. Shortcode attribute: onload_show_element_only=""

With the next 2 options you can modify the css of your iframe if it is on the same domain or if you can use the external workaround and have the pro version. This settings are save to the ai_external.js. The first option defines the id/class/element you want to modify and at the 2nd option you define the styles you want to change.

Content id in iframeShow a working example

Set the id of the element starting with a hash (#) that defines element you want to modify the css. You can use any valid jQuery selector pattern here! In the field below you then define the style you want to overwrite. You can also define more than one element. Please separate them by | and provide the styles below. Please read the note below how to find this id for other templates. #content|h2 means that you want to set a new style for the div content and the heading h2 below. Shortcode attribute: iframe_content_id=""

Content styles in iframeShow a working example

Define the styles that have to be overwritten to enable the full width. Most of the time you have to modify some of the following attributes: width, margin-left, margin-right, padding-left. Please use ; as separator between styles. If you have defined more than one element above (Content id in iframe) please separate the different style sets with |. The default values are: Wordpress default: 'width:450px;padding-left:45px;'. Twenty Ten: 'margin-left:20px;margin-right:240px'. iNove: 'width:605px'. Please read the note below how to find these styles for other templates. If you have defined #content|h2 at the Content id you can e.g. set 'width:650px;padding-left:25px;|padding-left:15px;'. Shortcode attribute: iframe_content_styles=""

Add css styles to iframe

This setting does add the css you enter here directly as last element to the body of the iframe page. The big difference to the two settings before is, that not the css styles are modified by Javascript but a style element is added directly to the iframe. The advantage is that also !important can be used to overwrite such styles. This setting is only supported for the same domain. The disadvantage is that adding the style element is still done after the iframe is fully loaded and that writting valid css is a little bit more complicated. Use "Write css directly" for the external workaround. Enter the styles without <style>. The value is sanitized at the output! Therefore not all styles do work! e.g. body > p cannot be used. Use external files if you need this. Shortcode attribute: iframe_content_css=""

With the next 2 options you can modify the target of links in your iframe if it is on the same domain or if you can use the external workaround and have the pro version. This settings are save to the ai_external.js. .

Change iframe links/forms targetShow a working example

Change links of the iframe page to open the url at a different target. This option does add the attribute target="your target" to the links you define. The targets are defined in the next setting. You can use any valid jQuery selector pattern here! So if your link e.g. has an id="link1" you have to use "a#link1". If you want to change all links e.g. in the div with the id="menu-div" you have to use "#menu-div a". The jQuery selector pattern help also shows how to identify all external links! Because brackets [ ... ] are replaced in the short code by Wordpress it has to be replaced with {{ ... }}. Also the target of a form can be changed. So using "form" will change the target of all forms. You can also define more than one element. Please separate them with |. Shortcode attribute: change_iframe_links=""

Change iframe links/forms target valueShow a working example

Here you define the targets for the links you define in the setting before. If you have defined more than one element above (Change iframe links) please separate the different targets with |. E.g. "_blank|_top". Shortcode attribute: change_iframe_links_target=""

Modify the parent page


Modify the parent page

With the following options you can modify your template on the fly to give the iframe more space! At most templates you would have to create a page template with a special css and this is quite complicated. By using the options below your template is modified on the fly by jQuery. Please look at the screenshots to make these options more clear. The options are very useful for templates that have a top navigation because otherwise your menu is gone! If you still want to do this you should add a back link to the page. The examples below are for Twenty Ten, iNove and the default Wordpress theme. Please also look at "Add css styles to parent" if you have the pro version because there the css is directly written to the page which should work for many setups!

Hide elements

This setting allows you to hide elements when the iframe is shown. This can be used to hide the sidebar or the heading. Usage: If you want to hide a div you have to enter a hash (#) followed by the id e.g. #sidebar. If you want to hide a heading which is a <h2> you have to enter h2. You can define several elements separated by , e.g. #sidebar,h2. This gives you a lot more space to show the content of the iframe. To get the id of the sidebar go to Appearance -> Editor -> Click on 'Sidebar' on the right side. Then look for the first 'div' you find. The id of this div is the one you need. For some common templates the id is e.g. #menu, #sidebar, or #primary. For Twenty Ten and iNove you can remove the sidebar directly: Page attributes -> Template -> no sidebar. Wordpress default: '#sidebar'. I recommend using firebug (see below) to find the elements and the ids. You can use any valid jQuery selector pattern here! Shortcode attribute: hide_elements=""

With the next 2 options you can modify the css of your parent page. The first option defines the id/class/element you want to modify and at the 2nd option you define the styles you want to change.

Content id

Some templates do not use the full width for their content and even most 'One column, no sidebar Page Template' templates only remove the sidebar but do not change the content width. Set the e.g. id of the div starting with a hash (#) that defines the content. You can use any valid jQuery selector pattern here! In the field below you then define the style you want to overwrite. For Twenty Ten and WordPress Default the id is #content, for iNove it is #main. You can also define more than one element. Please separate them with | and provide the styles below. Please read the note below how to find this id for other templates. #content|h2 means that you want to set a new style for the div content and the heading h2 below. Shortcode attribute: content_id=""

Content styles

Define the styles that have to be overwritten to enable the full width. Most of the time you have to modify some of the following attributes: width, margin-left, margin-right, padding-left. Please use ; as separator between styles. If you have defined more than one element above (Content id) please separate the different style sets with |. The default values are: Wordpress default: 'width:450px;padding-left:45px;'. Twenty Ten: 'margin-left:20px;margin-right:240px'. iNove: 'width:605px'. Read the note below how to find these styles for other templates. If you have defined #content|h2 at the Content id you can e.g. set 'width:650px;padding-left:25px;|padding-left:15px;'. Shortcode attribute: content_styles=""

Add css styles to parent

This setting does add the css you enter here directly where the plugin is written to the page. The difference to the settings before is, that the modification is not done by jQuery but the css is directly written to the parent. The advantage is that also !important can be used to overwrite such styles and that the modifications is not done after the whole page is loaded. You can also use this setting to configure "Hide elements" directly. The disadvantage is that the styles added where the plugin is written and do not overwrite the stlye rendered later and that writting valid css is a little bit more complicated. Enter the styles without <style>. The value is sanitized at the output! Therefore not all styles do work! e.g. body > p cannot be used. Use external files if you need this. Shortcode attribute: parent_content_css=""

Add css class to parent elements Yes     No

Sometimes it is not possible to modify existing css classes of the parent because they are also used somewhere else or there is no unique selector for this element. Setting this attribute to true causes that a new class is added at each parent of the iframe up to the body! If the element has an id the class is named "ai-class-(id)". Otherwise "ai-class-(number)" is added. Then it is easy to identify all parent elements of the iframe and modify them. If you have several iframes on one page the classes could not be unique anymore. You need to set "Include ai.js in the footer" to false if you want to use this! Shortcode attribute: add_css_class_parent="true" or add_css_class_parent="false"

Open iframe in layer


Open iframe in layer

With the following options you can modify your template on the fly to give the iframe more space! At most templates you would have to create a page template with a special css and this is quite complicated. By using the options below your template is modified on the fly by jQuery. Please look at the screenshots to make these options more clear. The options are very useful for templates that have a top navigation because otherwise your menu is gone! If you still want to do this you should add a back link to the page. The examples below are for Twenty Ten, iNove and the default Wordpress theme.

Change parent links target

Change links of the parent page to open the url inside the iframe. This option does add the attribute target="your id" to the links you define. You can use any valid jQuery selector pattern here! So if your link e.g. has an id="link1" you have to use "a#link1". If you want to change all links e.g. in the div with the id="menu-div" you have to use "#menu-div a". You can also define more than one element. Please separate them with ,. Because brackets [ ... ] are replaced in the short code by Wordpress it has to be replaced with {{ ... }}.. Shortcode attribute: change_parent_links_target=""

Show iframe as layerShow a working example Yes     External     No

If you enable this, the iframe is initally hidden and if you click on a link defined at "Change parent links target" the iframe is shown as a simple lighbox as overlay on the page. So if you use this for external links the user does not leave your page! "External" does simply open all links that are not on the same domain in a layer. The setting at "Change parent links target" is ignored than. This setting does overwrite some iframe settings like height, width and border! Show part of iframe, lazy load, hide part of iframe and iframe loader are disabled as they do not work with this feature. Shortcode attribute: show_iframe_as_layer="true", show_iframe_as_layer="external", show_iframe_as_layer="false"

Show layer 100% or original Yes     No     Original

Show the layer with 100% ("Yes") or 96% ("No"). Original does mean that the size you set for the iframe is set as max width/height of the layer and 96% if the parent is smaller than your height/width Shortcode attribute: show_iframe_as_layer_full="true", show_iframe_as_layer_full="false", show_iframe_as_layer_full="original"

Layer file idShow a working example

You can add an additional header/footer with custom html above or below the iframe in the layer. Header/Footer files need to be in the folder plugins/advanced-iframe-custom with the following naming convention: layer_{id}.html. The id has to be saved in this text field. Below you see the existing header/footer files and also you can create/edit/delete them. The content of this file is included into a div at the given position. You need to provide the height of your additional content in the next setting. Shortcodes in your custom file are supported! The placeholder {id} is replaced by the id of your iframe. This can be used to reuse a layer file where e.g. different images depending on the iframe should be shown. The id can only contain alphanumeric characters, - and _ . The placeholder {src} is replaced by the src of your iframe. This can be used to create a link like: "Go to this page". Shortcode attribute: show_iframe_as_layer_header_file=""

Layer header/footer height

The height of the additional layer. The height is needed to calculate the height of the iframe properly. Shortcode attribute: show_iframe_as_layer_header_height=""

Layer header postionShow a working example Top     Bottom

Show the additional area above or below the iframe. Shortcode attribute: show_iframe_as_layer_header_position="top" or show_iframe_as_layer_header_position="bottom"

Keep the content after closing Yes     No

To improve performance the content of an iframe is not loaded again if the same opening link is clicked again. It is only hidden and shown then. But sometimes it makes sense to unload the content if e.g. sound should be stopped or it is mandatory that the iframe shows the first page again. Shortcode attribute: show_iframe_as_layer_keep_content="true" or show_iframe_as_layer_keep_content="false"

Existing additional layer files

The following additional layer files in the folder "advanced-iframe-custom" currently exist. Please note that you can view/edit this files with the plugin editor of Wordpress by clicking on the "Edit/View" link.


layer_footer.html   Edit/View   Remove

layer_xxx.html   Edit/View   Remove


Create a custom layer file. Only specify the id. All files are named "layer_{id}.html":

Zoom


Zoom

All major browsers do support the zoom of iframes. Depending on your setup you can use a static zoom factor or even automatic zoom which does zoom the content depending on the available space. Please check the examples how the different zoom settings do work. Please note that the zoom below does only zoom the iframe. When you use the "Show only a part of the iframe" the inner content is zoomed. For zoom options of the viewport please check the settings at "Show only a part of the iframe"

Zoom iframeShow a working example

You can zoom the content of the iframe with this setting. E.g. entering 0.5 does resize the iframe to 50%. At the iframe width and height you need to enter the FULL size of the iframe. So if you enter width = 1000, height = 500 and zoom = 0.5 than the result will be 500x250. The following browsers are supported: IE8-11, Firefox, Chrome, Safari, Opera. Older versions of IE are not supported. Please test all the browsers you want to support with your page because not all pages do look good in a zoomed mode! "Show only a part of an iframe" and "Resize iframe to content height" are supported. Shortcode attribute: iframe_zoom=""

Support zoom on IE8 Yes     No

Zoom on IE8 does require the browser detection. And the browser detection does need a lot of memory during processing and is only available for php > 5.3.x. So by default the IE8 support of zoom is disabled. If you enable this and your server runs out of memory the plugin does automatically disable this support by creating a file called advanced-iframe-custom/browser-check-failed.txt. As long as this file does exist the IE8 support for zoom is disabled. Shortcode attribute: iframe_zoom_ie8="true" or iframe_zoom_ie8="false"

Zoom absolute fix Yes     No

Sometimes the zoom measurements need an additional position:absolute to work correctly. Only set this to true if the zooms doens not work as expected. Shortcode attribute: use_zoom_absolute_fix="true" or use_zoom_absolute_fix="false"

Auto zoom iframeShow a working example Same domain     Remote domain     No

This feature does automatically calculates the needed zoom factor to fit the iframe page into the parent page. Especially when you have a responsive website but the remote website is not responsive this is the only way that the page in the iframe does also zoom. Many smartphones and tablets to automatically zoom the parent page but not the iframe page. So there this feature can also be used. This feature works on the same domain and if you are able to use the external workaround and use auto height there (otherwise the width does not get transfered). Shortcode attribute: auto_zoom="same", auto_zoom="remote" or auto_zoom="false"

Auto zoom by ratioShow a working example

This setting can be used on the SAME domain if the height of the page cannot be mesured but the ratio of the page is known. And if the width also cannot be measured automatically but is known because the iframe page has a fixed width, you can specify this width by adding with a pipe like ratio|width. E.g. 0.80|800. If you know the the ratio and the width, this setting does also work on REMOTE domains. You don't even need access to the remote domain! For remote domains also select SAME in the setting before as remote means that the height/width information is sent from the remote domain which is not the case here. Shortcode attribute: auto_zoom_by_ratio=""

Lazy load


Lazy load

Iframes do often slow down the loading of pages because more content needs to be loaded at the same time.

The lazy load feature can improve this by loading the iframe only when needed and can be configured in several ways:

  1. The iframe is loaded when it is visible
  2. The iframe is loaded after the parent page is loaded
  3. The iframe is loaded manually
Enable lazy loadShow a working example Yes     No

You can enable that iframes are lazy loaded. If you enable this, the iframe is loaded either after the ready event of the parent or if the iframe gets visible. Please check the "Enable lazy load threshold" setting below how to configure this. Shortcode attribute: enable_lazy_load="true" or enable_lazy_load="false"

Lazy load threshold

This setting sets the pixels to load earlier. Setting the value e.g. to 200 causes iframe to load 200 pixels before it appears in the viewport. It should be greater or equal zero. The default is set to 3000 which normally is a lazy load after the parent finished loading. If you set this value higher then the distance of the iframe to the top, the iframe is lazy loaded after the parent document ready event is fired. If you leave this field empty 0 is used. Shortcode attribute: enable_lazy_load_threshold=""

Lazy load fadein time

This setting enables you to fade in the iframe after it is lazy loaded. Enter the time in milliseconds. Depending on the content of the iframe this looks good or not. Please test if you like the behaviour. If you leave this field empty 0 is used. Shortcode attribute: enable_lazy_load_fadetime=""

Reserve iframe spaceShow a working example Yes     No

By default the initial height of the iframe is reserved in the layout to avoid jumping when the iframe is loaded. "No" does not reserve the space anymore. Shortcode attribute: enable_lazy_load_reserve_space="true" or enable_lazy_load_reserve_space="false"

How trigger lazy loading Default (Scroll)     Auto     Manually

Normally (Default (Scroll)) the iframes are loaded lazy after the settings you specify above. The option "Auto" does check every 50 ms if the iframe is visible in the viewport and should be loaded. This is especially useful for iframes that are hidden when the page is loaded. So this can be used for hidden tabs because when this is shown no internal Javascipt event like scrolling does exist! If you use auto all iframes on the same page do poll because this is a global setting of the plugin. But you also can trigger the loading manually. This can also be used to lazy load tabs or when you want to load the iframe by yourself. For each iframe a Javascript function to show the iframe is created: aiLoadIframe_"your id"(); e.g. aiLoadIframe_advanced_iframe(); Simply call it when you want. Also see the next option! If you want to avoid polling for tabs use the manual setting. See the lazy load demo for an example. Shortcode attribute: enable_lazy_load_manual="false" enable_lazy_load_manual="auto" or enable_lazy_load_manual="true"

Element that triggers the lazy load

If you enable "How trigger lazy loading -> manually" you have a Javascript function that triggers the lazy load. With this setting you can add an click event with this Javascript function to the element you define here. So if you e.g. have a tab with the id="tab1" you simply enter #tab1 here. Any jQuery selector does work here. So you can even attach this to several elements. Shortcode attribute: enable_lazy_load_manual_element=""

Url parameter handling


Url parameter handling

Advanced iframe is able to forward parameter from the parent to the iframe url. In the pro version you are also able to map parameters and add the iframe url as parameter to the parent url. Also check the documentation at "Url". For pro users are many additional options to add wordpress or url data to the iframe url.

URL forward parameters

Define the parameters that should be passed from the browser url to the iframe url. Please separate the parameters by ','. Using "ALL" does forward every parameter.
GET and POST parameters are supported!
Pro users can also map incoming parameters to a different parameter. Wordpress has a couple of reserved words which can't be used in urls. So if you want to pass the parameter "name" (reserved word) to your iframe you can do a mapping with "ainame|name". Than the parameter "ainame=hallo" will be passed as "name=hallo" to the iframe. This can also be used if the parameters of the 2 pages do not match. Several mappings can be seperated with ',' like normal parameters. In e.g. TinyWebGallery this enables you to jump directly to an album or image although TinyWebGallery is included in an iframe. If your parameters contain [] you can use {{ }} which will internally replaced. Shortcode attribute: url_forward_parameter=""

Map parameter to url

You can map an url parameter value pair to an url or pass the url directly which should be opened in the iframe. If you e.g. have a page with the iframe and you like to have different content in the iframe depending on an url parameter than this is the setting you have to use. You have to specify this setting in the following syntax "parameter|value|url" e.g. "show|1|http://www.tinywebgallery.com". If you than open the parent page with ?show=1 than http://www.tinywebgallery.com is opened inside the iframe. You can also specify several mappings by separating them by ','.
GET and POST parameters are supported!
You can also only specify 1 parameter here! The value of this parameter is than used as iframe url. e.g. show=http%3A%2F%2Fwww.tinywebgallery.com%3Fparam=value. You need to encode the url if you pass it in the url. Especially ? (%3F) and & (%26)! Please note that because of security reason only whitelisted chars [a-zA-Z0-9/:?&.] are allowed. Encoded parameters in the passed urls are not supported because all input is decoded and checked. If no parameter/value pair does match the normal src attribute of the configuration is used. Shortcode attribute: map_parameter_to_url=""

Add iframe url as paramShow a working example Same domain     Remote domain     No

With this setting the url of the iframe is added as parameter to the current url. The parameter can be defined in the setting before. If this is not set the default "page" is used. This feature is only enabled for the remote domain if you also enable auto height for remote domains because the url of the iframe is sent with the same request. This enables bookmarkable urls where you go directly to the last page in the iframe. The history api which enables the change of the url is only supported by modern browsers. For older browsers the url is simply not changed. See http://caniuse.com/#search=pushstate. Shortcode attribute: add_iframe_url_as_param="same", add_iframe_url_as_param="remote" or add_iframe_url_as_param="false"

Prefix for iframe urlShow a working example

With this setting you can define a prefix which all (most) of your pages in the iframe have. This prefix is than not added to the url but added internally. This does reduce the length of the parameter value. The prefix has to be without http:// or https://. So a prefix could be www.tinywebgallery.com/examples/. If your pages are e.g. at www.tinywebgallery.com/examples/example1.htm and www.tinywebgallery.com/examples/example2.htm than the page parameter is only page=example2.htm and not page=www.tinywebgallery.com%2Fexamples%2Fexample2.htm. See the demo for a working example. Shortcode attribute: add_iframe_url_as_param_prefix=""



External workaround: Howto enable cross domain resize and modification

Use this solution if the iframe is NOT on the same domain and you want features like auto height and css modifications.

The external workaround does enable many features which are not possible directly because of cross domain security restrictions. You need to include a Javascript file (ai_exernal.js) to the page in the iframe which is generated dynamically with your settings. If you mix http and https pages you NEED to enable "Use postMessage for communication" and follow example 53 for this advanced setup (pro version needed)! In the advanced tab are many settings marked with . This means that this setting is saved to the ai_exernal.js

Important: You need to be able to modify the external web page in the iframe to use the workaround!

Step 1: Check if the page in the iframe has the same second level domain. e.g. www.example.com, subdomain.example.com -> second level domain: example.com:

If you are on a different domain (not sub domain):

Info: Currently selected communication channel: iframe. See here what this means.

Everything is already prepared what you need on the parent domain. For the remote page the Javascript file ai_external.js is generated when you save the settings. This file hat to be included into your external iframe page:

  1. Add the following Javascript to the external web page you want to show in the iframe (The optimal place is before the </body> if possible. Otherwise put it in the head section. NEVER place it just after the <body> as than the height of the script element would be measured!):

    Show me what the Javascript does

    The Javascript does the following:
    • Adds "aiUpdateIframeHeight()" to the onload event of the page
    • Sends the height, width and optional data to the parent to enable auto height
    • Modifies the remote iframe page (pro version only) - Please see below how to configure this.
    • Adds the communication iframe dynamically if iframe communication is used
    • Adds an optional wrapper div below the body that the height can be measured properly
    • Removes any margin, padding from the body
    • Adds a temporary overflow:hidden to the body to avoid scrollbars

  2. Add enable_external_height_workaround="true" to your shortcode! This is needed to disable the settings with the for the same domain.
  3. Enable the features you want to use. Please note: All settings here and also in the other sections which are marked with a are saved to the external ai_external.js workaround file!
  4. Done. Click here if it does not work.

    If it does not work please check the following things:

    1. Use Chrome for debugging
    2. Force a full reload (win: ctrl + F5)
    3. Clean the browser cache
    4. I recommend to start with auto height only. Open the Javascript console (press F12 to open the developer tools of the browser), check for errors and fix them. Advanced iframe does also show configuration errors there!
    5. Check if ai_external.js is loaded in the network tab (F12). If you do not see it check if the file is included properly.
    6. If you have enabled "Use postMessage for communication" set it to "Debug" and check the output in the Javascript console.
    7. If you use iframe communication check the network tab (F12), filter for doc/html and look for height.html. There you should see the measured height as parameter. If this does not show switch to postMessage communication as this way has less restrictions.
    8. If you mix http and https you need to enable "Use postMessage for communication" and "Support WP multisite"
    9. Enable the internal debug console (Options -> Debug Javascript) if you have only problems on mobile devices.
    10. Go to the Help/ FAQ tab. There you find additional infos and links to the FAQ and the forum

Resize remote iframe to content heightShow a working example Yes     External     No

Enable the auto height workaround by enabling it in the generated Javascript file ai_external.js. This settings only works if you have included the Javascript to the remote page.
Important:
"Yes" does disable all settings with a in the administration for the same domain and enables auto height in the ai_externals.js! This is needed as otherwise the plugin would try to use this settings directly which causes Javascript security errors! Only set this if ALL of your iframes are remote!
"External" does enable the setting only in the ai_externals.js. This is the default now as auto height is than working right away. You need to set enable_external_height_workaround="true" or use_shortcode_attributes_only="true" in the shortcode for iframes with external pages that the settings from the administration are not used directly.
So if you use several iframes with the external workaround and the same domain you should set this setting to "External" and set enable_external_height_workaround="true" in the short code for full flexibility. Please see below how to configure ai_external.js directly.

Element to measure

This parameter defines the element that is measured on the remote page. "default" tries to measure the first element of the body or the wrapper div. But sometimes this does not work if e.g. the element does return a wrong height because of css styles or dynamically added elements. You can use the id directly here or you can also a valid jQuery selector pattern here that start with # or .! Sometimes also adding the style overflow:hidden to the element you want to measure is needed. You can do this direcly in your html or with the plugin dynamically. Please read the section "How to find the id and the attributes" to find the right id or class. This setting cannot be set by a shortcode. Please see below how to configure ai_external.js directly.

Additional height

If you like that the iframe is higher than the calculated value you can add some extra height here. This number is then added to the calculated one. This is e.g. needed if one of your tested browsers displays a scrollbar because of 1 or 2 pixel. Or if there is an additional margin around the body. This setting cannot be set by a shortcode. Please see below how to configure ai_external.js directly.

Resize/ css modification delay

Sometimes the external page does not have its full height and all elements after loading because e.g. parts of the page are build by Javascript. If this is the case you can define a timeout in millisecounds until the resize and the modification of elements are called. Otherwise set a 0 to disable the delay. This setting cannot be set by a shortcode. Please see below how to configure ai_external.js directly.

Keep overflow:hidden after resizeShow a working example Yes     No

By default overflow:hidden (removes any scrollbars inside the iframe) is set during the resize to avoid scrollbars and is removed afterwards to allow scrollbars if e.g. the content changes because of dynamic elements. If you set this setting to true the overflow:hidden is not removed and any scrollbars are not shown. This is e.g. helpful if the page is still to wide! If you want to use several iframes please use the description below for configuration. These settings only works if you have included the Javascript to the remote page. This setting cannot be set by a shortcode. Please see below how to configure ai_external.js directly.

Hide the iframe until it is completely modified.Show a working example Yes     No

This setting hides the iframe until the external workaround is completely done. This prevents that you see the original site before any modifications. You need to enable this AND in the shortcode. The normal "Hide the iframe until it is loaded" shows the iframe after all modifications are done which are all done by a local script. This way cannot be used for the external workaround because the exact time when the external modifications are done is unknown. Therefore the setting in the shortcode does hide in iframe until the external workaround does call iaShowIframe after all modifications are done. Shortcode attribute: hide_page_until_loaded_external="true" or hide_page_until_loaded_external="false"

Write css directlyShow a working example Yes     No

By default changes off the iframe are made by jQuery after the page is loaded. This is the only way this is possible if you do this directly. But with the external workaround it is now also possible that the style is written directly to the page. It is written where the ai_external.js is included. So if you use this option you need to include the ai_external.js as last element in the header. This setting has the advantage that the changes are not done after the page is loaded but when the browser renders the page initially. Also the page is not hidden until the page is fully modified. The settings "Hide elements in iframe" and "Modify content in iframe" are supported! This setting cannot be set by a shortcode. Please see below how to configure ai_external.js directly.

Iframe redirect urlShow a working example

If you like that the page you want to include can only be viewed in your iframe you can define the parent url here. If someone tries to open the url directly he will be redirected to this url. Existing parameters from the original url are added to the new url IF no ? is found in the iframe_redirect_url. You need to add the possible parameters to the "URL forward parameters" that they will be passed to the iframe again. This setting does use Javascript for the redirect. If Javascript is turned off the user can still access the site. If you also want to avoid this add "html {visibility:hidden;}" to the style sheet of your iframe page. Than the page is simply white. The Javascript does set the page visible after it is loaded! iframe_redirect_url does now also check if the page is included by the domain specified. Otherwise it is redirected to the iframe_redirect_url. This way you can make sure that the iframe page can only be included by a page on your domain. Please see the additional option below you have if you define this parameter before the ai_external.js. This setting cannot be set by a shortcode. Please see below how to configure ai_external.js directly.

Add the id to the url of the iframeShow a working example

This feature adds the id of the iframe to the iframe url. The id is than extracted on the iframe and used as value for the callback to find the right iframe on the parent side. The static way is to set iframe_id (Please see below). The dynamic solution has to be used if you want to include the same page several times to the parent page (e.g. the page you include is called with different parameters and shows different content). You specify the parameter that is added to the url. So e.g. ai_id can be used. Allowed values are only a-zA-Z0-9_. Do NOT use any other characters. You need to set the parameter here or by setting iframe_url_id before you include ai_external.js. Please note the if you specify it here ALL shortcodes with use_shortcode_parameters_only="true" need pass_id_by_url to be set. See example 27 for a working setup. Shortcode: pass_id_by_url=""

Keep iframe modifications outside iframeShow a working example Yes     No

Please note: This is a really advanced feature! Please ask in the forum if you plan to use this! Normally the page in the iframe is only modified if it is in the iframe. But sometimes the page in the iframe does not work properly in the iframe in a workflow. So you need to jump out out of the iframe. But you maybe still want to hide/modify the content of this page even outside the iframe. This feature does enable this by setting a session cookie. If you enable this feature a cookie is set if you do modifications in the iframe and even if you jump out of the iframe the modifications are still done. This setting cannot be set by a shortcode. Please see below how to configure ai_external.js directly.

Support WP multisiteShow a working example Yes     No

By default the callback url is rendered to the ai_external.js. For WP multi sites the default setting does than only work for one of the domains. "Yes" does enable that the Javascript compares the default url with the one from the referrer. Than the default domain will be exchanged with the one from the referrer. This only works if the domain is the only difference between the multi sites. Please see below how to configure ai_external.js directly. If you only enable this in ai_external.js directly you need to use multi_domain_enabled="true" in the shortcode! If you use postMessage for communication please read the documenation there how to use this setting!

Please note: If you change the settings above I recommend to reload the iframe page in a different tab because otherwise the page is cached by many browsers!

Please test with all browsers! If the wrapper div is needed (It has a transparent border of 1px!) and it causes layout problems you have to remove the wrapper div in the Javascript file and you have to measure the body. The alternative solution is stored as comment in the Javascript file. The Javascript file is regenerated each time you save the settings on this page.

How to configure the "Modifies the remote iframe page" options

The configuration which is rendered by default to the Javascript is the one you enter in the settings of "Modify the content of the iframe if the iframe page is on the same domain".

How to configure the workaround file ai_external.js directly to work with different settings.

The file ai_external.js is created when you save the settings. If you want to have different settings for different pages you can define the parameters which are used in the script before you include the file ai_external.js.

Please note: All parameters can be set in the administration. This are the settings where a is shown! You only need to define variables before the script or a configuration file if you need to include the SAME ai_external.js with DIFFERENT configurations. See the FAQ for more details.

The following parameters can be used:

Show me the parameters.

  • iframe_id - By default the id from the settings are used. If you want to use several iframes on the same page with the external workaround you need to specify the id from the shortcode.
  • updateIframeHeight - Enable/disable the resize height workaround. Valid values are "true", "false".
  • keepOverflowHidden - Enable/disable if the overflow:hidden is kept. Valid values are "true", "false".
  • hide_page_until_loaded_external - Enable/disable that the page is hidden until fully modified. Valid values are "true". Needs only to be set on the remote site if you do not use auto height because otherwise no request is sent back!, "false".
  • iframe_hide_elements - See Hide elements in iframe.
  • onload_show_element_only - See Show only one element
  • iframe_content_id - See Content id in iframe
  • iframe_content_styles - See Content styles in iframe
  • change_iframe_links - See Change iframe links
  • change_iframe_links_target - See Change iframe links target
  • onload_resize_delay - See resize delay above. E.g. var onload_resize_delay=100; means 100 ms resize delay. You also need this setting when you use the hidden tabs feature.
  • iframe_redirect_url - Defines an url which is loaded if the page is not included in an iframe. See "Iframe redirect url" above. As an additional option you can use Javascript to add e.g. the current domain to the redirect url! So e.g. var iframe_redirect_url = "http://parent-domain?page=" + escape(window.location.href); would add the iframe url as parameter to the parent. If a ? is found in the iframe_redirect_url then the parameters of the iframe page are NOT added to the redirect url!
  • write_css_directly - See "Write css directly" above. Valid settings are write_css_directly="true" or write_css_directly="false".
  • additional_css_file_iframe - The ai_external.js can also load an additional css file. This is loaded at the end of ai_external.js. The advantage using this is that the file is only loaded if the page is inside the iframe and is not loaded when accessed directly. Please note that the file is loaded asynchronously.
  • additional_js_iframe - The ai_external.js can also write additional Javscript. This is loaded at the end of ai_external.js. The advantage using this is that the Javascript is only loaded if the page is inside the iframe and is not loaded when accessed directly.
  • additional_js_file_iframe - The ai_external.js can also load an additional Javascript file. This is loaded at the end of ai_external.js. The advantage using this is that the file is only loaded if the page is inside the iframe and is not loaded when accessed directly. Please note that the file is loaded asynchronously.
  • resize_on_element_resize - See "Resize on element resize"
  • resize_on_element_resize_delay - See "Poll interval for the resize detection"
  • iframe_url_id - See "Add the id to the url of the iframe"
  • element_to_measure - You can define the element you want to measure + a offset for fix content. This is sometimes needed for some themes where e.g. chrome returns 0 as height. You need to specify a id. So no # is allowed here.
  • element_to_measure - The element you want to measure. See "element to measure" above
  • element_to_measure_offset - The additional height for a the measured content. See "Additional height"
  • modify_iframe_if_cookie - Enable/disable that the modifications of an iframe is done even outside an iframe. See "Keep iframe modifications outside iframe". Valid values are "true", "false".
  • add_iframe_url_as_param - See "Add iframe url as param"
  • additional_styles_wrapper_div - Adds additional styles to the wrapper div. Depending on the html/css this is sometimes needed that the element can be measured correctly. overflow:auto; is sometimes needed!
  • domainMultisite - Enable/disable multi site settings. See above. Valid values are "true", "false".
  • usePostMessage - Enable/disable the usage of postMessage for communication. See above. Valid values are true, false.
  • debugPostMessage - Enable/disable the debug of postMessage for communication. See above. Valid values are true, false.
  • dataPostMessage - Defines the elementes that should be transfered to the client. See above.

An example would look like this:

<script>
   var updateIframeHeight = "true";
   var keepOverflowHidden = "false";
</script>
<script src="http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>

Config files for the external workaround

Defining the variables before the script has the disadvantage that you need to modify the html of the remote domain for every change and also the code there can get really big. Therefore it is now possible to use config files which are located on the parent server and loaded dynamically from the external_ai.js. Config files have to be placed in the folder "advanced-iframe-custom" in the plugin directory (This directory does not exist by default and is created if you use the create input filed below) and need to follow this naming convention: ai_external_config_<config_id>.js. This file does contain exactly the variables described before. Then you need to add the config_id as parameter to the external_ai.js like this: ..../ai_external.js?config_id=<config_id>. The config_id can only contain alphanumeric characters, - and _.

You can also include the config file directly before the ai_external.js script. This gives you the same flexibility but you have to include 2 scripts. The performance including this directly is a little bit better because no internal loading has to be done!

Please note: The folder "advanced-iframe-custom" is used because Wordpress does delete the whole plugin folder at an update and all your settings would be lost! If you delete the plugin completely you need to remove the folder "advanced-iframe-custom" manually if you don't want to keep this settings!

Show me the example above with a config file

In this example the config_id "example" is used.

  1. First create a file called "ai_external_config_example.js" in the folder "advanced-iframe-custom" of the plugin directoy (or create the file below) and save the following lines there:
       var updateIframeHeight = "true";
       var keepOverflowHidden = "false";
  2. a. Add the parameter ?config_id=example to the external_ai.js
        <script src="http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe/js/ai_external.js?config_id=example"></script>
    or
    b. <script src="http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe-custom/ai_external_config_example.js"></script>
        <script src="http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe/js/ai_external.js"></script>
  3. Done. Make sure that you refresh the browser cache if you make changes to your config file. Example 7 shows a working setup.

Existing config files

The following configuration files do currently exist. Please note that you can view/edit this files with the plugin editor of Wordpress by clicking on the "Edit/View" link. Hover over the script you want to include and click 3 times fast to select it. Than add the line before your ai_external.js if you use the 2nd way to include the configuration.


ai_external_config_example7.js   Edit/View   Remove
<script src="http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe-custom/ai_external_config_example7.js"></script>


Create a config file with the following id:

Load different configurations depending on an url parameter

Important: If you want to include one external page into more than one iframe only one configuration for the external page is possible by default. An advanced topic is to switch configurations depending on an url parameter. This requires to create a custom version of the config switcher template that is included in the js folder of the plugin and called ai_config_switcher_template.js.

Please make a copy of this file and copy it to the folder advanced-iframe-custom. If you want to have this config file listed above please use the following naming ai_external_config_<config_id>.js. Please follow the documenation inside the config switcher file. If you need more complex configurations like this I recommend to get the professional support offered for this plugin because then an indivitual solution has to be designed and a custom version of the plugin would be needed.



Add additional files

All settings above are designed for smaller changes of the parent or the iframe. If you want to make bigger changes and you are able to store this in a file including a whole file is the better solution. Below you can add additional Javascript or css files to the different pages.

Please note: The files are edited/viewed by the default Worpdress plugin editor! It is o.k. that "inactive" is shown in the editor as the advanced-iframe-custom folder is not a real plugin folder. If the editor does not work because of file permissions please edit the files directly on your server.

Existing additional files

The following additional files in the folder "advanced-iframe-custom" currently exist. Please note that you can view/edit this files with the plugin editor of Wordpress by clicking on the "Edit/View" link. Hover over the file you want to include and click 3 times fast to select it.


custom_iframesizer.js   Edit/View   Remove
http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe-custom/custom_iframesizer.js

custom_m_querries.css   Edit/View   Remove
http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe-custom/custom_m_querries.css

custom_media_query_hide.css   Edit/View   Remove
http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe-custom/custom_media_query_hide.css

custom_media_query_show_part.css   Edit/View   Remove
http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe-custom/custom_media_query_show_part.css

custom_onload.js   Edit/View   Remove
http://www.tinywebgallery.com/blog/wp-content/plugins/advanced-iframe-custom/custom_onload.js


Create a custom file. Only files with the extensions css or js are allowed. All files are prefixed with "custom_":

Parent

For some features in iframes additional css or js files are needed in the parent(!) page. E.g. for the newest version of lytebox this is needed. Each of the files do get a version number which is randomly changed each time you save the settings. So if you change the css or the js file you should save the settings to make sure your users to get the new version right away and not a chached one. If you need to add css or Javascipt to the iframe please check the settings of the external workaround.

Additional css

If you want to include an additional css into the parent page please specify the path to this file here. The css file will be added into the header of the page. You can specify a full or relative url. Make sure you take "CSS specificity" into account if you want to overwrite styles! If you specify a relative one /style.css means that the style.css is located in the main directory of Wordpress. Start relative urls with /. Please note: Before Wordpress 3.3 the shortcode attribute cannot be used. You can only set it here. Shortcode attribute: additional_css=""

Additional js

If you want to include an additional Javascript into the parent page please specify the path to this file here. The Javascript will be added after the iframe or if you use Wordpress >= 3.3 in the footer section. You can specify a full or relative url. If you specify a relative one /javascript.js means that the javascript.js is located in the main directory of Wordpress. Start relative urls with /. Please note: Before Wordpress 3.3 the shortcode attribute cannot be used. You can only set it here. Shortcode attribute: additional_js=""

Iframe

You can also include a css file directly into the iframe page. This setting is also saved in the external workaround file. In the external workaround file the settings below are written at the place where the ai_external.js is included!

Additional css in iframe

You can also include a css file directly into the iframe page. The css file will be added at the bottom of the body to overwrite also all inline styles. The styles are added after the page is loaded. Make sure you take "CSS specificity" into account if you want to overwrite styles! You can specify a full or relative url. If you specify a relative one /style.css means that the style.css is located in the main directory of the iframe page. In the external workaround the file is added after the ai_external.js. Shortcode attribute: additional_css_file_iframe=""

Additional Javascript in iframe

You can also include a js file directly into the iframe page. The js file will be added at the bottom of the body. You can specify a full or relative url. If you specify a relative one /javascript.js means that the javascript.js is located in the main directory of the iframe page. In the external workaround the file is added after the ai_external.js. Shortcode attribute: additional_js_file_iframe=""


Include content directly

You can also include content directly with jQuery. The page is loaded and the part you specify below is included by Javascript into the page. The cool thing is that you can specify an id or a class which specify the content area that should be included. This feature does only work if the page is loaded from the SAME domain.. If you use the setting below no iframe is used anymore. So only include stuff that is for display only.
Please note: Loading the external content is done after the page is fully loaded and takes some time. Therefore some extra settings below are possible to make the integration as invisible as possible. The included div has the id ai_temp_>iframe_name<. So if you need to overwrite some css you can put it in an extra file and add this in the section "Additional files"

"Include html" does write the given string directly and all other settings are not used!

Include url

Enter the full URL to your page you want to include. e.g. http://www.tinywebgallery.com. If you specify this then the page is included directly, the iframe settings above are not used and no iframe is included.. Shortcode attribute: include_url=""

Include content

You can specify an id or a class which specify the content area that should be included. For an id please use e.g. #id, for a class use .class. Shortcode attribute: include_content=""

Include height

You can specify the height of the content that should be included. If you do this the space for the content is already reserved and this prevents that you maybe see when the page gets updated. You should specify the value in px. Shortcode attribute: include_height=""

Include fade

You can specify a fade in time that is used when the content is done loading. If you leave this setting entry the content is shown right away. If you specify a time in milliseconds then this content is faded in in the given time. This does sometimes looks nicer than if the content suddenly appears. Shortcode attribute: include_fade=""

Hide page until include is loaded Yes     No

If you like to hide the whole page until the extra content is loaded you should set this to 'Yes'. You should test this setting and decide what looks best for you. Shortcode attribute: include_hide_page_until_loaded="true" or include_hide_page_until_loaded="false"

Include html

If you enter something here the given string is written instead of an iframe. This is especially helpful if you e.g. use the browser detection and you want to display a simple text, image or link instead of the iframe in this case. If you set this include_url is also ignored! Only the following tags are allowed: br, em, p, div(id, class, style), a(href, target, class, style), img(src, class, style, width, height). Shortcode attribute: include_html=""



Video tutorials

The videos are not included in the plugin directly as they will be extended soon on the website.

Go to the video tutorials


FAQ

The FAQ is not included in the plugin directly as it is updated frequently on the website.

Go to the FAQ


Forum

Please use the forum for support. Make sure to enable the "Check shortcode" on the options tab first as this maybe already show you which setting is not valid!

Go to the forum


Get support

The basic settings are the settings a normal iframe solution does offer. They don't require any specific html, css or programming knowhow.

The advanced options do modify the styles of the parent page, the iframe, do some Javascript magic when the iframe is loaded or include content directly to your page. Understanding this is not basic Wordpress knowhow and therefore you can get help here if you want. I do offer paid support for this plugin now.

What do you get?

  •      - Free check if you can include the content the way YOU like.
  •      - Fast and reliable setup of what you want.
  •      - You only pay if it works!

This offer is only available for Advanced iFrame Pro users.
If you are interested please visit http://www.tinywebgallery.com/blog/advanced-iframe-support/ for more information.


How to find ids and attributes

  1. Manually: Go to Appearance -> Editor and select the page template. Then you have to look which div elements are defined. e.g. container, content, main. Also classes can be defined here. Then you have to select the style sheet below and search for this ids and classes and look which one does define the width of you content.
  2. Firebug: For Firefox you can use the plugin firebug to select the content element directly in the page. On the right side the styles are always shown. Look for the styles that set the width or any bigger margins. These are the values you can then overwrite by the settings above.
  3. Small jquery help
    Above you have to use the jQuery syntax:

    • - tags - if you want to hide/modify a tag directly (e.g. h1, h2) simply use it directly e.g. h1,h2
    • - id - if you want to hide/modify an element where you have the id use #id
    • - class - if you want to hide/modify an element where you have the class use .class

    You can use any valid jQuery selector pattern here!


Small jQuery help

You can use jquery selector patterns directly to identify the elements you want to modify at some of the settings. This plugin does use this selectors than at the right place. This is already an advanced topic if you are not familiar with jQuery.

Show me a small jQuery selector help.

I have created a small jquery selector help which is optimized for the advanced iframes scenarios. It is an extract from http://refcardz.dzone.com/refcardz/jquery-selectors#refcard-download-social-buttons-display. So please go there if you need an extended version or give someone credit.

What are jQuery selectors?

jQuery selectors are one of the most important aspects of the jQuery library. These selectors use familiar CSS syntax to allow page authors to quickly and easily identify any set of page elements to operate upon with the jQuery library methods. Understanding jQuery selectors is the key to using the jQuery library most effectively. The selector is a string expression that identifies the set of DOM elements that will be collected into a matched set to be operated upon by the jQuery methods.

Types of jQuery selectors?

There are three categories of jQuery selectors: Basic CSS selectors, Positional selectors, and Custom jQuery selectors.

The Basic Selectors are known as "find selectors" as they are used to find elements within the DOM. The Positional and Custom Selectors are "filter selectors" as they filter a set of elements (which defaults to the entire set of elements in the DOM). This extract will focus on the basic selectors as they are most important and will cover most of your needs.

Basic CSS Selectors

These selectors follow standard CSS3 syntax and semantics. For more selectors and examples go to http://api.jquery.com//category/selectors.

Syntax Description
* Matches any element.
E Matches all elements with tag name E.
E F Matches all elements with tag name F that are descendants of E.
E>F Use E##F. ## is converted to >. Matches all elements with tag name F that are direct children of E.
E+F Matches all elements with tag name F that are immediately preceded by a sibling of tag name E.
E~F Matches all elements with tag name F that are preceded by any sibling of tag name E.
E.c Matches all elements E that possess a class name of c. Omitting E is identical to *.c.
E#i Matches all elements E that possess an id value of i. Omitting E is identical to *#i.
E[a] Matches all elements E that posses an attribute a of any value.
E[a=v] Matches all elements E that posses an attribute a whose value is exactly v.
E[a^=v] Matches all elements E that posses an attribute a whose value starts with v.
E[a$=v] Matches all elements E that posses an attribute a whose value ends with v.
E[a*=v] Matches all elements E that posses an attribute a whose value contains v.

Additional useful selectors

These selectors are basic filters provided by jQuery I found useful using in this plugin. For more selectors and examples go to http://api.jquery.com//category/selectors.

E:not(selector) Remove elements from the set of matched elements.
E:eq(index) Select the element at index n within the matched set.
E:last() Selects the last matched element.
E:nth-child(index) Selects all elements that are the nth-child of their parent.

Examples

  • $("div") selects all <div> elements
  • $("fieldset a") selects all <a> elements within <fieldset> elements
  • $("li##p") selects all <p> elements that are direct children of <li> elements
  • $("div~p") selects all <div> elements that are preceded by a <p> element
  • $("p:has(b)") selects all <p> elements that contain a <b> element
  • $("div.someClass") selects all <div> elements with a class name of someClass
  • $(".someClass") selects all elements with class name someClass
  • $("#testButton") selects the element with the id value of testButton
  • $("img[alt]") selects all <img> elements that possess an alt attribute
  • $("a[href$=.pdf]") selects all <a> elements that possess an href attribute that ends in .pdf
  • $("a[href='example.html']") selects all <a> elements that has the href example.html
  • $("a[href*='example.html']") selects all <a> elements where the href does contain example.html
  • $("a[href^='http://www.tinywebgallery.com']") selects all <a> elements that has a href that starts with http://www.tinywebgallery.com
  • $("a:not([href^='http://www.tinywebgallery.com'])") selects all <a> elements that has a href that does NOT start with http://www.tinywebgallery.com. This can be used to detect external links and add target="_blank" there.
  • $("button[id*=test]") selects all buttons whose id attributes contain test
  • $("tr:not(.keep)") selects all table row that don't have the class "keep"
  • $("table:nth-child(1)") selects the 2nd row of a table

You can create the union of multiple disparate selectors by listing them, separated by commas. For example, the following matches all <div> and <p> elements: div,p

Usage in Advanced iframe

Above the default usage in jQuery is shown in the examples In Advanced iFrame the jQuery part is already rendered by the plugin. Therefore you only need to specify the selector. Also the following two rules apply:
  1. Only single quotes are allowed. So please always use ' and never ".
  2. Because brackets [ ... ] are replaced in the short code by Wordpress you need to replace [...] them with {{ ... }}
Examples:
  • $("div") -> div
  • $("p:has(b)") -> p:has(b)
  • $("a[href$=.pdf]") -> a{{href$=.pdf}}
  • a[href="example.html"] -> a{{href='example.html'}}

Advanced iframe browser detection

Pro users can now specify browser specific iframes. This is imporant especially for the "Show only part of the iframe" feature where browser differences of a few pixels can matter. But you can use this for other things as well because mobile, iphone, ipad can also be detected.

Show me how to configure the browser detection in advanced iframe pro.

Modern website designs are not pixel based anymore and depending on the features of the browser they also look slightly different. So if you use the "Show only part of the iframe" feature it is possible that the area you want to cut out of the website is at a slightly different place. You can also use the browser detection to show different iframes for different browsers or even mobile devices.

Setup

If you want to have different iframe configurations depending on the browser you have to use the shortcode attribute browser="" and define the browsers there which should be used for this shortcode. See the different configuration options below. You can define several browsers by separaring them by, and even define browser versions by adding the versions with (version). Each of the shortcodes which are browser dependent need to have the same id! The last shortcode should have the attribute browser="default". This is then used if no browser does match before. If you don't do this you can show iframes only for a specific browser.

Example 1 - Special settings for IE 10 and IE 11

[advanced_iframe id="example1" show_part_of_iframe_x="25" browser="ie(10),ie(11)"]
[advanced_iframe id="example1" show_part_of_iframe_x="20" browser="default"]

Example 2 - Special settings for IE, Firefox and Chrome

[advanced_iframe id="example2" show_part_of_iframe_x="25" browser="ie"]
[advanced_iframe id="example2" show_part_of_iframe_x="23" browser="firefox,chrome"]
[advanced_iframe id="example2" show_part_of_iframe_x="20" browser="default"]

Example 3 - Show a different iframe on iframe on apple devices and mobile devices

[advanced_iframe id="example3" src="apple iframe" browser="iphone,ipad,ipod"]
[advanced_iframe id="example3" src="other mobile devices iframe" browser="mobile"]
[advanced_iframe id="example3" src="normal iframe" browser="default"]

Configuration options

The following options for most common browsers can be used:
  • ie - Selects all versions of Internet Explorer. Also a version is supported. ie(10) selects IE10, ie(11) selects IE11
  • safari - Selects all versions of Safari. Also a version is supported. Add the version in (). e.g. safari(5)
  • firefox - Selects all versions of Firefox. Also a version is supported. Add the version in (). e.g. firefox(20)
  • chrome - Selects all versions of Chrome. Also a version is supported. Add the version in (). e.g. chrome(25)
  • opera - Selects all versions of Opera. Also a version is supported. Add the version in (). e.g. opera(20)
  • ipad - Selects all versions of ipad.
  • ipod - Selects all versions of ipod.
  • iphone - Selects all versions of iphone.
  • mobile - Selects all mobile devices.
  • tablet - Selects all tablet devices.
  • android - Selects all android devices.
  • androidtablet - Selects all android tablet devices.
  • desktop - Selects all desktop browsers.
  • browser - Selects all browsers. Desktop, tablet and mobile. Can be used to show something only for browsers and e.g for crawlers you can use the default and show nothing.
  • default - Is used if no other advanced iframe pro with the same id was selected before.

Credit and update

Advanced iFrame Pro uses an integrated browser detection which is based on the wordpress plugin php-browser-detection 3.2.

If the automatich update does not work you can get an updated version of the browsercap.ini lite file here: http://browscap.org/
Please use the light version as it conains all settings for the provided settings !

If you want to update the browser detection file get the lite_php_browscap.ini from there and rename it to php-browser-detection/cache/browscap.ini.
Or always get the latest version of the advanced iframe pro plugin. This file is also updated there!


Communication with window.postMessage or iframe

There are two ways how the page in the iframe can communicate with the parent to send e.g. the height:

  1. window.postMessage - Pro version only. Now the default for new installations.
  2. hidden iframe - Show me more infos how the iframe communication way works.
If the parent page (the page where the iframe is) and the iframe page (the page which is inside the iframe) are NOT on the same domain it is only possible to do the above stuff by including an additional iframe to the remote page which than can call a script on the parent domain that can then access the functions there. A detailed documentation how this works is described here:

http://www.codecouch.com/2008/10/cross-site-scripting-xss-using-iframes - This plugin does wrap everything that is described there. Simple follow the steps below.

The following steps are needed:
  1. The parent page has a Javascript function that resizes the iframe
  2. The external iframe page has an additional hidden iframe, an onload attribute at the body and a javascript function
  3. A page on the parent domain does exist that is included by the hidden iframe that calls the function on the parent page

Using window.postMessage has the following advantages/disadvantages

  • + The external workaround does also work when https pages are included to http pages! (See example 53)
  • + You can include the same iframe page into several parents much easier!
  • + Additional data can be transferred as no browser url restrictions do apply (See example 52)
  • + No additional hidden iframe has to be added to the page.
  • - Not supported by IE <= 8

One advantage of the iframe communcation is that by default you see the callbacks to height.html in the network. So is was always easy to debug out of the box. window.postMessage by default is not visible like that. If you have any problems with window.postMessage select "Debug" at "Use postMessage communication" and log information about the transfered data is printed to the browser console. Use F12 at your browser to open the developer tools.

When the first version plugin was planned the percentage of browsers that not supported window.postMessage was ~20%. But now this has changed. The latest browser statistics show that IE <= 8 browsers have dropped to ~ 0.2%. And as many websites do not support such old browsers either the new default is now window.postMessage for new pro installations.

Existing installations can switch to window.postMessage by changing this in the administration and save it. But you still can use the old way as it works fine as well.



Wordpress Flash Uploader, TinyWebGallery, Joomla Flash Uploader

This plugin is the extract for the iframe wrapper which was written for the TinyWebGallery. I needed an iframe wrapper that could do more than simply include a page. It needed to pass parameters to the iframe and modify the template on the fly to get more space for TWG. If you want to integrate TWG please use the "TinyWebGallery wrapper". It offers specific features only needed for the gallery. I hope this standalone wrapper is useful for other Wordpress users as well.

Please take a look at my other projects: Wordpress Flash Uploader, TinyWebGallery, Joomla Flash Uploader or TWG Flash Uploader. If you like TWG or one of my other projects like JFU, WFU or TFU you should consider registering, because you can use all products with one single license, get all features of the gallery and a complete upload solution as well.

Please go www.tinywebgallery.com for details.



Advanced iFrame Pro - Quickstart guide, plugin options, widget, vote for the plugin on codecanyon

Quick start guide

Show me the quickstart video

To include a web page to your page please check the following things first:

Most likely you have one of the following setups:

  1. iframe cannot be included: You cannot include the content because the owner does not allow this.
  2. iframe can be included and you are on a different domain: See the feature comparison chart and the features availability overview. To resize the content to the height/width or modify css you need to modify the remote iframe page by adding one line of Javascript to enable the provided workaround.
  3. Iframe can be included and you are on the same domain: All features of the plugin can be used.

To enter a simple iframe please go to the administration and follow the instructions on the basic settings tab. There you can either use a basic shortcode and set the settings in the administration or overwrite the settings directly in the shortcode. Please also read the FAQ and look at the free and pro examples.

Advanced users that have their own server might also setup a reverse proxy if the iframe page is on a different domain and cannot use the external workaround. See this blog for details.
If you mix http and https read this blog. Parent https and iframe http does not work on all browsers!

Plugin options

Show this section as last tab Yes     No

You can show this tab as last tab after you have read it. Then the basic tab is shown first.

Check shortcode Yes     No

If you enable this the plugin does check if the shortcode attributes are known. You will find typos, wrong quotes and missing spaces. It does not check the values! The only reason this is not enabled by default is to make sure that old shortcodes don't show a warning after an update! I stongly recommend to enable this setting!

Enable expert mode Yes     No

If you enable the expert mode the description is only shown if you click on the label of the setting. You see more settings at once but only one description at once. Also the padding between the table rows are reduced a lot. So you see a lot of more settings on one screen. Use this if you are common with the settings.

Use footer save button Yes     No

The new default is that the save button is in a sticky footer. I was testing this for all major browsers but not for all worpress versions. So if this does not work for your version set this to false to get one save button for each section.

Use accordeon menu on the advanced tab

The accordeon menu on the advanced tab does not show the different sections in one big page but does only show the sections you open. You can define the default section which is open by default here also. Sections do not close if you open another one because sometimes is is useful to open several sections at once. Also the quick jump links at the top are removed because they do not make sense then anymore. The menu is used after you saved this setting. Only important sections are offered in the dropdown.

Alternative shortcode

You can define an alternative shortcode the plugin should evaluate. This is e.g. useful if you chance/upgrade from iframe to advanced iframe (pro). Simply insert "iframe" in the text field. Most if the parameters do already match! Make sure to deactivate the other plugin that used the shortcode. With using iframe also the BBCode [iframe]url[/iframe] is supported. IMPORTANT: If you use this, security codes are NOT checked anymore. So anyone who can e.g. write a post can also insert an iframe!

Show plugin in main menu Yes     No

Show the "Advanced iFrame Pro" Menu link also in the main menu. If set to "False" it is only shown in the settings menu.

Allow shortcode attributes Yes     No

Allow to set attributes in the shortcode. All of the attributes can be overwritten in the shortcode if you set 'Yes'. Otherwise the settings you specify here are used.

Use shortcode attributes only Yes     No

All iframes you use in your pages use the administration. With shortcode attributes you can overwrite these settings. When you use several iframes with different settings this can lead to strange behavior because you do not see the whole configuration in the shortcode. By setting this option to true only the parameters defined as attributes are used. You can set this for a single iframe as well with the shortcode attribute use_shortcode_attributes_only="true". Shortcode attribute: use_shortcode_attributes_only="true" or use_shortcode_attributes_only="false"

Include ai.js in the footer Yes     No

By default the needed Javascripts are included at the footer. So you can include jQuery also at the footer if you like. If you like/need it in the header set this value to false. Before Wordpress 3.3 jQuery is needed in the header if you want to use lazy-loading! The ai.js has also to be in the footer if it should only be loaded when the shortcode is on the page. This setting cannot be set as shortcode! There is an additional shortcode attribute called include_scripts_in_content="true". This is only needed in the special case if you use the page with content only (like using the plugin "Show Content Only" with "Content + Styles" mode). Then ai.js is directly rendered before the iframe. See demo wrapped auto height.

Load jQuery as dependency Yes     No

By default jQuery is loaded as dependeny. If you have a theme or another plugin that does not stick to the Wordpress way to load the scripts you might have to disable the dependeny. This avoids that jQuery is loaded again and other plugins do maybe not work anymore.

Editor button

With this setting you can add an "advanced iframe" button to the text editor of Wordpress. The button does add the shortcode with the current security code if set + the settings you define. You can use any setting from the administration. By default src,width,height is used. The securitykey is additionally rendered if you specify one. If you leave this setting empty the button is not shown.

Enable content filterShow a working example Yes     No

This feature does not render an iframe. It gives you the option to filter the content of your page by an id. So you can offer parts of your page that then can be included into any iframe. You only need to specify the id of the element you want to show with the parameter ?ai-show-id-only=id. If you only specify this parameter the whole page is loaded and then with Javascript all other elements are hidden. If you add ai-server-side=1 to the url the content is filtered on the server side but this only works for elements which are in the content area because everything else depends on the template. By default overflow (scrolling) is hidden inside the iframe. If you like that scrollbars are shown if needed add &ai-show-overflow=1 to the url. Also check "Add ai_external.js local" as this actually the even more powerfull solution but more complicated to setup. So try what fits best to your needs! Also the height of the content is sent to the parent by a post message. Please see the demo how you can use this and code you need to include to use this the optimal way.

Add ai_external.js localShow a working example Site     Admin     All     No

The setting does add the ai_external.js to your own site. This enables you to provide parts of your site into an external iframe or use the external workaround for the same domain. This is simelar to "enable_content_filter" where you can filter parts of your page. The advantage of this solution is that you can use all css modifications and auto height of this solution. Also resize of element resize does work here. Also this works on included links if they still stay on the page. The disadvantage is that it is more complecated to setup then "enable_content_filter" and only one configuration is supported automatically. Also the height of the content is sent to the parent by a post message. If you like to include the script only to a single page use the shortcode [ai_advanced_js_local] to your page. Then the script will be included to your footer. You can even add custom settings like described on the external workaround page by adding a script to the content. You can enable this for the site, the admin pages or both. Please see the demo how you can use this and code you need to include to use this the optimal way.

Debug JavascriptShow a working example No     Bottom of page

You can enable that most messages from the Javascript console are shown in a debug div which shown at the bottom of the page. This is very useful if you have problems on Android or IOS because there it is quite hard to get on the infos displayed in the Javascript log. Important: You need to use the external workaround with postMessage set to debug(!) (see the external workaround tab) if you also want to get the messages from the page in the iframe! Also the current user agent, the headers and a basic iframe check of the first found iframe are printed into the debug log. Click on the debug area to enlage and shrink it. Shortcode attribute: debug_js="no/bottom"

Check Url on load Yes     No

By default the url on the basic tab is checked if it can be included into an iframe. Some servers do block this feature and the administration does fail then. If this is the case the plugin does disable this check and "Check iframes on save" automatically. You can enable this feature again if you allow curl calls on your server.

Check iframes on save Check for errors only     Check for errors and warnings     Do not check iframes on save

You can define if you show errors only, errors and warnings or if iframes are not checked at all at save. Some servers do block this feature and you get a blank page on save once. If this is the case the plugin does disable this check automatically. You can enable this feature again if you allow curl calls on your server.

Check all iframes once a day Yes     No

You can automatically check all iframes of your site once a day. IF you upgrade from an older version please deactive and active the plugin once to get the cronjob setup properly! The same function like on the "Basic" tab -> Url -> "Check all iframes" is triggered here. Be aware that default wordpress cronjobs are triggered by the user that hits the next execution time and therefore this user has to wait until this checkis done! In the status e-mail you find also how long the check needed. Because of this performance impact the cron job check only checks until an error happens. So please go to the administration if you get an e-mail for a full check! If the checks of your iframes takes longer than 5 sec. I recommend to switch to a native cronjob if possible. Google for "wordpress cronjob replace" and also add your hoster! Because native cronjobs can not be created everywhere and also often depends on your package. To test cronjobs you can e.g. use the plugin "WP Crontrol" where you can simply execute this cronjob.

Check iframe cronjob email

You can define an alternative e-mail the iframe status check is sent to. If you leave this field empty the admin e-mail from "Settings -> Email Address" is used. You can define several e-mails seperating them by ",".

Minimum user role

You can define the minimum user role a user needs to use the advanced iframe plugin. This limits the access to the administration, the editor button and if a user can edit a page with a advanced iframe shortcode. If a page with an advanced iframe is detected and the rights are not sufficient an error message is displayed and the user can not edit the page! A user with insufficient rights still can add the shortcode if he has the security code! This settings only works optimal for the 5 default user roles as it depends on the order of roles! So please check if this settings works for you if you have additional roles! Default restrictions means that the administration is only shown for administrators and the editor button for everyone who can edit a post/page. This setting can only be changed by an administrator!

Warning: Illegal copies of Advanced iFrame Pro

Unfortuatelly for most good plugins on codecanyon also illegal versions can be found in the internet. Please make sure you got your version from codecanyon. Very often, the scripts are modified and allow hackers to access your server. These are very dangerous to use! I already found hacked versions with backdoors!

The only offical version of Advanced iFrame Pro can be found here: http://codecanyon.net/item/advanced-iframe-pro/5344999

Thank you.

Advanced iFrame Pro Widget

The pro version also does offer a widget where you can include the iframe. The usage is really simple. Go to Appearance -> Widgets and insert the shortcode you would normally put into a page into the text field of the "Advanced iFrame Pro Widget" .

Vote for the plugin

Thank you for getting Advanced iFrame Pro at Codecanyon.
Please feel free to leave an item rating from your items download page if you haven't already done so.

Please get in contact with me if you have problems because most of the issues are easy to solve. But at least tell me what you did not like so I can improve this. Also make sure that you took a look at the quick start guide to make sure the feature you like can be used!