The new cross-site includes feature lets you include the source of one page into another. We're finding lots of use for this powerful extension to normal includes, which used to work only inside one site. I'm going to show you a simple way of getting a live 'view' of another page.
Here, for example, is a page describing the design of a new feature for embedding HTML directly into a page.
Originally suggested by pieterh on 13 October 2009.
This is a design sketch for embedding HTML into Wikidot pages. The idea is based on the design of an Iframe module by James Kanjo.
We propose a syntax extension:
[[html ...arguments...]]
<h1>
My example header
</h1>
<p>
My awesome paragraph.
</p>
[[/html]]
This creates an HTML page on a separate server, creates an iframe to embed that HTML page into the current page, and adds JavaScript that automatically resizes the iframe to match the HTML size.
This is a secure sandboxing of the HTML: it cannot access the encapsulating page nor can it use the session's security information.
The code for this is:
[[div style="border: 1px solid grey; padding: 1em; background:white"]]
[[include :projects:thread:131]]
[[/div]]
Mind you if you defined some cool theme for your site… the imported page will enherit wich theme? I'll investigate and report back…
Here is my report:
The theme of the hosting site will be applied to the included page…
This is probably in 80% of the cases very cool but could cause some special effects:
Have a look at the original http://ethischforum.wikidot.com/
and the included in another site http://hackedforum.wikidot.com/csi
Some times iframing will be a better solution
An other thing… images or other items that are reffered to in a relative way could loose their path
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
Dear Steven,
I think you misunderstand the purpose of a CSI. The aim is not to iframe a page from one site into another but to include the source code of a page. The internal [[include]] does exactly the same.
Indeed the first line of Pieter's post
should be
You remember the replacment of the design pages to the project forum? Well it was done like that and Pieter saw that… so this and also the example he gives on this page is an example of including full pages… the difference with the old or regular include is that this now works CROSS SITE, wich is very cool
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
James, could you please create something which helps me, when hovering over
and clicking on ":projects:thread:131" , go straight to http://projects.wikidot.com/thread:131 ?
I don't know what you mean…
Do you mean a way for you to include a page, but have a link to it so you can see the original?
Create an “include external” page
[http://{$site}.wikidot.com/{$category}:{$name} View Original Page]
[[include :{$site}:{$category}:{$name}]]
Then include this page:
Is this what you meant?
@gerdami, I actually have an issue pending for this (link to includes in source view…)
Portfolio
[[include :projects:thread:131]]
coded by
(Edited by gerdami)
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
@Steven
Well, the result is what I was thinking to… but not the means.
@James
I meant something like on http://csi.wikidot.com/, when hovering over [[include :projects:thread:131]]
It needs some javascript to reconstitute the URI of :projects:thread:131 … and some CSS, I guess.
If you think the syntax is to complex for what it needs to do…
Maybe we can do it with a CSI
So you will only pass the content… the rest will be generated by the include…
But then how do we fix if there is more in the code block besides [[include :....]]
I'll do another attempt
[[include :mycsi:csicode-linked
link=http://projects.wikidot.com/thread:131 |
text=include :projects:thread:131]]
Better?
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.