Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding iframe in Wikimedia based Wiki

Tags:

html

iframe

wiki

I have been trying to embed an iframe to a wiki page that I'm working on based on wikimedia but not the actual wikipedia without any luck.

I've also tried googling on this topic, but have been fruitless. Will appreciate any advice on this pls.

Thks.

like image 459
user1079950 Avatar asked Dec 04 '11 10:12

user1079950


People also ask

How do I embed HTML into Wikipedia?

To embed a web part in an HTML wiki page, open the page for editing and go to the HTML Source tab. (Do not try to preview using the Visual tab, because this will cause <p> tags to be placed around your script, often breaking it.)

How do I embed an iframe?

To embed an iframe in a content page, select Interactive layout, choose the HTML block and paste the iframe code there. You can adjust the iframe width and height properties. To embed an iframe using the Old (Classic) editor, click on the Embed Media icon and paste the code in the appropriate field.

Which is better iframe or embed?

EMBED is basically the same as IFRAME, only with fewer attributes. Formally, EMBED is an HTML 5 tag, but on several browsers it will also work for HTML 4.01, if you are using this. It just cannot be validated. As always HTML 5 is recommended for the pages.

Can any website be embedded in an iframe?

Websites that begin with https can in most instances be embedded as iFrames. The exception to this is where the original website does not allow itself to be embedded.


2 Answers

I suggest you use the IDisplay extension.

The iDisplay extension allows MediaWiki pages to embed external web pages. It also allows setting an option to put a blocking page in front of it, so you prevent loading the page until the user wants to load the page.

It's implemented with an <iframe>.

like image 56
Julian Avatar answered Oct 18 '22 18:10

Julian


There's the easy way and the slightly harder way.

The easy way assumes you don't have a publicly editable wiki (i.e. non-logged in users cannot edit and creating an account is not automatic).

If that's the case, simply set $wgRawHtml to true and you will be able to input any arbitrary HTML into your pages by wrapping it inside the <html> tag.

Here's an example:

This is '''wikitext'''.

<html>
This is <em>HTML</em>.
</html>

Now, if you have a publicly editable wiki you most definitely don't want users to be able to add any and all HTML to your wiki. In that case you can use the Verbatim extension. This will embed the contents of a page in the MediaWiki namespace as-is, preserving any HTML markup.

For example:

<verbatim>Foo</verbatim>

Would embed the contents of MediaWiki:Foo.

Hope that helps.

like image 40
tor Avatar answered Oct 18 '22 20:10

tor