Release status: beta
|Implementation||Tag, Special page|
|Description||Allows to integrate external web pages into a page|
|Author(s)||Sigbert Klinke (Sigberttalk)|
|Latest version||0.07 (2018-08-06)|
|License||GNU General Public License 3.0|
|Translate the Iframe extension if it is available at translatewiki.net|
|Check usage and version matrix.|
Copyright & security issues
Embedding external webpage into MediaWiki has two issues:
- Copyright violation: Embedding an external web page may violate copyrights. So, make sure that the domains that can be used in the extension are trusted!
- Security issue: External web pages may contain malicious code. Again make sure that the domains that can be used in the extension are trusted!
The extension uses keys to select web servers which are given by the wiki adminstrator during installation. Therefore, behind the key should only be trusted domains.
- The extension does not work properly with the MobileFrontend extension.
You can obtain the extension from Github.
- Go to the extensions directory and
- clone it from GitHub
git clone https://github.com/sigbertklinke/Iframe
- Add to the bottom of LocalSettings.php
wfLoadExtension( 'Iframe' );
The global variable $wgIframe controls various aspects of the extensions, e.g. additional web adresses, delay of iframe loadings etc.
Adding other web addresses
If want to add own keys/servers then add in LocalSettings.php after loading the extension
$wgIframe['server']['mykey'] = [ 'scheme' => 'https', 'domain' => 'mydomain' ];
This will allow you to use in wiki pages:
<iframe key="mykey" path="" />
For easy finding of all wiki pages which have a
<iframe ... />
inside a category is added by
the name of the category can be controlled in LocalSettings.php by setting
$wgIframe['category'] = 'Iframe';
- The extension does NOT create the page Category:Iframe, that is left to the wiki administrator or user.
- If you create the page Category:Iframe then it might be useful to use hidden categories.
Width and height of an iframe
The default width and height of an iframe is 800x600 pixel. This can be set in LocalSettings.php via
$wgIframe['width'] = 640; $wgIframe['height'] = 400;
If no width and height is given than these defaults are used.
Delay of iframe loading
- If in LocalSettings.php (or any negative value) is set then the iframe(s) will be loaded immediately, no delay will take place.
$wgIframe['delay'] = -1;
- If in LocalSettings.php (the default) is set then the first iframe will be loaded 100 ms after the document is loaded, the second 200 ms, and so on.
$wgIframe['delay'] = 100;
1. Shows the test page of my shiny server
<iframe key="wiwi" path="" />
<iframe key="wiwi" path="examples" />
3. As 2., but the iframe window has only VGA size (640x480).
<iframe key="wiwi" path="examples" size="vga" />
iframe has the following attributes
|size||Size of an iframe window||Optional, for an overview see iframe.ods. Setting |
|height||Height of an iframe window||Optional. Default: |
|width||Width of an iframe window||Optional. Default: |
|key||Select a specific domain||Required. Default: |
|level||Domain prefix||Optional. Default: empty|
|path||Path in domain||Required. Default: empty|
|allowfullscreen||Frame is allowed to be placed into full screen mode||Optional.|
The final URL is build by
domain are given by the
key, e.g. the examples above will generate the URLs
Note: you can abbreviate the keys, e.g. for the examples above could be used
<iframe k="wiwi" p="" />
<iframe k="wiwi" p="examples" />
<iframe k="wiwi" p="examples" s="vga" />
Usage in templates
If you want to use the iframe tag in templates then use in the template:
This will also allow to embed parameters, e.g.
- Old MM-Stat wiki (development wiki) (in german)
- New MM-Stat wiki (in german), Special page, Example page
There is a mailing list available: email@example.com. Note: as author of the extension I rarely read the discusson page but I read my e-mail every day ;)