Add iframe url as param: Same domain

This demo works for HTTP and HTTPS. You are on HTTPS right now Please click here to get to the HTTP version.

< back to the overview of "Add iframe url to parent"

Example 32: Add iframe url as param: Same domain

This example shows how the current iframe url is added to the parent url as parameter if the iframe is on the SAME domain. This features is only available in the pro version of the advanced iframe.

To make it easier to copy/paste the examples most examples are fully configured in the shortcode directly. I use use_shortcode_attributes_only="true" that none of the settings from the administration are used.

The following two settings are the important ones:

  • map_parameter_to_url="iframe" - This enables that the value of parameter "iframe" should be opened inside the iframe
  • add_iframe_url_as_param="same" - This enables that the iframe url is on the same domain and should be added to the parameter defined at map_parameter_to_url

Click on the links in the iframe and check the url in the address bar. Also reload the page when you are on a different page. The current page in the iframe should be opened again.

Additionally the feature "Use iframe title for parent" is enabled. For the same domain the setting is use_iframe_title_for_parent="same".

This is the shortcode for this:
[advanced_iframe securitykey="your key" src="//www.tinywebgallery.com/blog/e33/page1.html" use_shortcode_attributes_only="true" id="example32" height="150" width="310" map_parameter_to_url="iframe"  add_iframe_url_as_param="same" use_iframe_title_for_parent="same"]