IncludeSite
Question
How can I include a complete page in a wiki page?
Answer
First, be sure you're aware of the security and possible copyright risks of letting the content of other (arbitrary!) URLs appear in your pages.
Once you've gotten past that hurdle, download includeSite_7.2.phpΔ, rename it to includeSite.php and put it into the cookbook/ directory.
Add the following line into your config.php
include_once("cookbook/includeSite.php");
That adds a (:includeSite http://...:)
markup that lets you embed the contents of other pages into a wiki page.
The URL must be the first parameter and must be followed by a space even if you don't use any parameter.
Supported (optional) fields are:
- height = in pixels, just the number
- width = in pixels, just the number
- border = in pixels, just the number
- scroll = "auto"/"yes"/"no"
- align = default/"left"/"right"/"middle"/"top"/"bottom"
- style = a string, that represents a valid CSS-Style as "border: 2px solid blue;"
- id = valid string
If the fields are not specified, the script defaults will be used. You can set these defaults in the script or (better) in the file config.php.
Include in your file lokal/config.php one or more of the following lines:
$DefaultWidth = 600; $DefaultHeight = 400; $DefaultAlign = 'left'; // left, right, middle, top, bottom $DefaultScroll = 'auto'; // auto, yes, no $DefaultStyle = 'border:3px outset #aaa; ';
Notes
The formerly parameter 'border' (thickness of the border) should no longer be used. It is replaced by 'style'. Nevertheless, existing 'border' parameters will be transformed into a 'style' parameter. And that is why you should not use both 'border' and 'style' as parameters.
Examples
(:includeSite https://example.com width=700 height=330 scroll="yes" border=15 align="middle" :) (:includeSite https://example.com/ border=7 :) (:includeSite https://example.com/subpage height=700 scroll="yes" style='border:2px solid red' id="my_name" width=500:)
See Also
Contributors
- MFWolff
- fraz
- StevenLeite (original author)
Comments
See discussion at IncludeSite-Talk
User notes +2: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.