IncludeSite-Talk
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
Comments
PHP7.2
I have
- updated the file cookbook/includeSite.php to includeSite_7.2.phpΔ.
- added the parameters 'id' and 'style' (HTML(5)-conform)
- rearranged the evaluation of the parameters
see description in includeSite
MFWolff March 27, 2019, at 08:40 AM
I just added a recipe EmbedMore which is really just thoughts on how to use IncludeSite, but I thought it would be less distracting to have it on its own page.
As a note on how to include Wikipedia pages:
To get a clean embed, you won't want all the common page navigation trappings so here's how I trimmed them off.
I used the following code to embed an article on the Telegraph, but making sure that it shows up properly credited as a Wikipedia page:
[[https://en.wikipedia.org/static/images/project-logos/enwiki.png"Wikipedia Logo" | - %newwin% [[ Wikipedia:Telegraphy | Full Wikipedia Page - ]]
(:includeSite http://en.wikipedia.org/wiki/Telegraphy?printable=yes:)
Notice the page URL includes the ending "?printable=yes" for Wikipedia pages, this strips away the rest of the page decoration (Navigation, Logo, SideBar etc.) leaving just the content.
?printable=yes in Wikipedia does not seem to work any longer. I do not know if/how it will still be possible to set an ad hoc skin with ?useskin (like in ?useskin=timeless). As of today ?useskin=timeless&printable=yes seems to work, but shows a notice. --Luigi 23 Jan 2023
PHP5.5 Compatibility Issue
M. Denning, 20170729: I made the changes concerning the php5.5 warning from mark-up (below my comments) in config.sys and re-ran ruleset with a skip-cache reload. It is still throwing the following compatibility error. Please, can this be addressed ASAP? Base site is battzion.org and WebMaster contact is at the bottom. Thanks!
includeSite directives B>>>= ! file: /cookbook/includeSite.php, line: 111, pat: /\(:includeSite\s+(http:[^<>"{}|\\^`()[\]']*?)\s*:\)/e
Update: | I have updated line 111 |
---|---|
FROM | Markup('includeSite', 'directives', "/\\(:includeSite\\s+(http:[^$UrlExcludeChars]*?)\\s*:\\)/e", "includeSite('$1')"); |
TO | Markup_e('includeSite', 'directives', "/\\(:includeSite\\s+(https?:[^$UrlExcludeChars]*?)\\s*:\\)/", "includeSite(\$m[1])"); |
TakeAway: | This seems to have taken away the error generated in Rule Table. |
AfterThought: | However, I would still be more comfortable if I obtained positive word from the other developers that this was the only updated necessary. |
Mark-Up PHP5.5 Warning
The script causes warnings under php5.5 because of the deprecated /e switch for the preg_replace() function. To fix this change
Markup('includeSite', 'directives', "/\\(:includeSite\\s+(http:[^$UrlExcludeChars]*?)\\s*:\\)/e", "includeSite('$1')");
to
Markup_e('includeSite', 'directives', "/\\(:includeSite\\s+(https?:[^$UrlExcludeChars]*?)\\s*:\\)/", "includeSite(\$m[1])");
This changes also allows you to include both, http and https sites with (:includeSite ... :)
, no need to use (:includeSecureSite ... :)
as suggested by Chris.
- Kurt (2015-Nov-22)
I'm using this on an https site and I noticed that I cannot include https sites. I found (I'm no php programmer) that adding
Markup('includeSecureSite', 'directives', "/\\(:includeSecureSite\\s+(https:[^$UrlExcludeChars]*?)\\s*:\\)/e", "includeSite('$1')");
to the last line (before the ?>
) allows me to include https sites with the markup (:includeSecureSite https://...:)
. I hope this helps others and can be added to the official version (either as I've done it or more elegantly) some day.
-Chris (3/29/2012)
Is there a way to get rid of the 2cm whitespace above the included site? DirkBlaas
Yes, remove the two " $Output .= "\n\n<!--/ X-include -->\n\n";" lines from includeSite.php. -computerdude33
I found this to be a great way to incorporate dynamic content into our intranet however the regex used to parse the parameters seems to mangle urls with parameters. Is there a workaround or should I work on fixing this. --dddavis
How do I use the above supported (optional) fields? The recipe works great, but the default size is not really well-suited for my application, and I can't seem to change it. Thanks in advance! :-) --Henning February 03, 2006, at 10:52 AM
It works for me, for example: (:includeSite http://www.google.com height=600 border=0:) -Mushiro February 14, 2006, at 10:50 AM
I couldn't get percent directive work such as height=90%. It goes back to the default height when ever I use percent option. If the content is longer than the default height value, scroll bars appear (I added scroll=no option too). Has any one tested percent height ? Thanks -Ali Friday, June 02 2006
I use this cookbook and using % in the height line doesn't work for me either. I have found that height=400px works well for my tastes. Try using a pixel setting instead of a percent setting. - IanMacGregor Sunday, August 27, 2006
The problem of heigh percentage not working, has nothing to do with this script. It's an HTML problem. Height percentage only works when the containing block has a known height. Typically, it doesn't. If you place the iframe in a block with for example height=200px, then the percentage does work. So this will depend on the skin of your site... Anthony. 23.11.2007
Talk page for the IncludeSite recipe (users).