Extension talk:IframePage

About this board

Is it possible to allow fullscreen?

1
MarcusBlitz (talkcontribs)

Is there any way to allow a fullscreen mode? I successfully integrated another webpage but the option fullscreen within this site is not clickable.

Reply to "Is it possible to allow fullscreen?"
Polymath uk (talkcontribs)

The install instructions didn't work for me. The line:

require_once "$IP/extensions/IframePage/IframePage.php";

gave me the white screen of death. Instead I changed the line in LocalSettings,php to read:

wfLoadExtension( 'IframePage' );

and this fixed it.

Reply to "Installation"

Specify iFrame size in Special:IframePage call

2
144.58.40.11 (talkcontribs)

Similar to how you can specify the size of an image on a page using one of the parameter inputs: e.g.

File:CycleLifeCurve.PNG
Cycle life is highly dependent on how the system is operated

Is there a way to specify the size of the the iFramePage call? e.g. Special:IframePage

At the moment the iFramePage stretched across the screen horizontally.

Thanks!

Tosfos (talkcontribs)

It should be possible. I'd try to select the iframe element with some CSS and give it a width.

Reply to "Specify iFrame size in Special:IframePage call"

Including iframe in template

2
82.134.94.226 (talkcontribs)

I have a template Template:MapTest with this text:


<iframe key="google" path="maps/embed?pb=\{\{\{map\}\}\}" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>


And I try to include it in a page like this:


\{\{\{MapTest|map=!4m5!3m4!1s0x4761e04f538c63e7:0x50f2a3d385586140!8m2!3d43.9787249!4d15.3846242\}\}\}

But for reasons I don't understand, this does not produce a map. IF I just put it verbatime like this, it works:

<iframe key="google" path="maps/embed?pb=!4m5!3m4!1s0x4761e04f538c63e7:0x50f2a3d385586140!8m2!3d43.9787249!4d15.3846242" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>


How would I succeed at this?


PS: I escaped { with \ to avoid the editor trying to run my wikitext in this talk post.

Tosfos (talkcontribs)

That's not how this extension works. Instead of struggling with this, I'd say your best bet is to try the Maps extension, or the Iframe widget.

Reply to "Including iframe in template"

Autofit frame size to contents

4
Roips (talkcontribs)

Added the following line inside SpecialIframePage.php to cause the iframe's size to fit its contents:

'onload' => 'document.getElementById(\'iframeframe\').style.height = (this.contentWindow.document.body.offsetHeight + 20) + \'px\''

Don't forget to add a comma because it's inside an array.

The full snippet is:

$html .= Html::element( 'iframe',

array( 'id' => "iframe-$srcName",

'src' => $src,

'frameborder' => '0',

'width' => '100%',

'height' => '100%',

'onload' => 'document.getElementById(\'iframeframe\').style.height = (this.contentWindow

.document.body.offsetHeight + 20) + \'px\''

)

);

P.S.: It's mainly used to put Apache's Directory Listing inside a frame at my wiki pages

Smason3346 (talkcontribs)

If the iframe is on a different domain, then you may get a console error saying the access to document (on the iframe) is restricted. That is built into the browsers to prevent cross-site scripting attacks.

To get around this I edited my SpecialIframePage.php to allow a height parameter.

Add this line (under where the $path gets assigned)

$height = $request->getVal( 'height' );

$height = ( empty($height) ) ? "100%" : $height;

Finally put the height as a dynamic parameter:

$html .= Html::element( 'iframe',

                array( 'id' => "iframe-$srcName",

                'src' => $src,

                'frameborder' => '1',

                'width' => '100%',

                'height' =>  $height                

                )

So now my call on the page that includes the iframe looks like this:

{{Special:IframePage | Name-Of-Iframe | height=950px}}

And if you don't enter the height as a parameter it uses what was the default before.

71.46.232.141 (talkcontribs)

This didn't work for me. The height never changed. Is there something else that needs to be done?

Yokiria (talkcontribs)

Had the same problem, so I'm replying here how I solved it.

The create iframe has a min-height property by default (500px I think), si you need to override it if you need less than that.


Here's my code :

$html .= Html::element( 'iframe',

               array( 'id' => "iframe-$srcName",

               'src' => $src,

               'frameborder' => '1',

               'width' => '100%',

               'height' =>  $height ,

              'style' => "height: $height; min-height: 100px"

               )

Reply to "Autofit frame size to contents"
RibeyeOnTheBone (talkcontribs)

I seem to have the IframePage installed ok. Showing as installed on the Versions page, for example.

Except, only hard coded URL is working. When I try to use the path as a parameter for the video number Vemio is giving "oops. The embedded code for this video is not valid".

Localsettings.php

require_once "$IP/extensions/IframePage/IframePage.php";

$wgIframePageSrc = array( 'Vimeo' => 'https://player.vimeo.com/video/' );

$wgIframePageAllowPath = true;

URL

/index.php?title=Special:IframePage/Vimeo?path=138841991

The following in the Localsettings.ini , with hard coded video id works as excepted

$wgIframePageSrc = array( 'Vimeo' => 'https://player.vimeo.com/video/138841991'

);

What I am doing wrong? Is there an approach to de-bugging?

Tosfos (talkcontribs)

It looks like the path is the issue. Two question marks in a path won't work. Try it with:

/index.php?title=Special:IframePage/Vimeo&path=138841991

Reply to "Getting path going"

Can't embed multiple pages

2
101.98.169.168 (talkcontribs)

Hi there. I'm a newbie so please forgive...

I want to embed two different websites in one of my wiki pages (version 1.29.1) but can only get the first one in the array to display. With the below code, I end up with the same page embedded twice! Also, if I use the pipe (|) before 'path', my wiki shows "404, key not found". Your help is appreciated.

Localsettings.php is as below:

require_once "$IP/extensions/IframePage/IframePage.php";

$wgIframePageSrc= array( 'Congo' =>'https://datawrapper.dwcdn.net/iJgI6/2/','googlenz'=>'https://www.google.co.nz' );

$wgIframePageAllowPath = true;

My Wiki is as below:

{{Special:IframePage|Congo?path=https://datawrapper.dwcdn.net/iJgI6/2/}}

{{Special:IframePage|googlenz?path=https://www.google.co.nz}}

101.98.169.168 (talkcontribs)

All solved now. I used the "piping" instructions from earlier in this discussion. Basically, I wasn't following the instructions correctly.

Reply to "Can't embed multiple pages"
Cclavadetscher (talkcontribs)

Hi

I noticed that if I use the extension using https and needs to embed a page that only speaks http I don't get the content. The contrary also applies. The links in $wgIframePageSrc include the protocol, but it seems to be ignored.

Is there any workaround to that?

Thank you and bye

Charles

BFeely (talkcontribs)

If your website is HTTPS, then this is expected behavior. All "active" assets in a HTTPS page have to be HTTPS, which is a security feature of all web browsers.

Reply to "Protocol awareness"

Problems with piping:

3
132.252.215.221 (talkcontribs)

I'm running MW 1.28.

Two pages are noted in the array in localsettings:

$wgIframePageSrc = array( 'learningapps' => 'https://learningapps.org/watch?v=', 'YouTube' => 'http://www.youtube.com/embed/' );

When using the extension via special:Iframepage/ .... Both sources work fine.

If I use the piping route via : {{Special:IframePage|'YouTube'|path=XXX}} , the extension behaves as if no parameter was given, defaulting to whatever comes first (in the above example of $wgIframePageSrc learningapps, but if I switch position it defaults to Youtube.

132.252.215.221 (talkcontribs)

ugh..

Thanks to Areoids reply I realised:

If you need to pass in the url then use pipes the same way you would for other mediawiki templates: {{Special:IframePage|Youtube|path=sYgxTkg2j5Hxoeei/embed}}

should be

{{Special:IframePage/Youtube|path=sYgxTkg2j5Hxoeei/embed}}

212.232.61.156 (talkcontribs)

23423423

Reply to "Problems with piping:"

Can I have more than one iframe page?

1
192.174.72.128 (talkcontribs)

Can I have more than one iframe page?

Reply to "Can I have more than one iframe page?"
Return to "IframePage" page.