IncludeWikiPage
Question
How can I syndicate wiki pages from other PmWiki 2.0 sites on my site and have them formatted using my site's CSS?
Answer
First, be sure you're aware of the possible copyright risks of letting the content of other wiki pages appear in your pages.
Once you've gotten past that hurdle, the following code in your config.php adds the (:includewikipage http://...:) markup that lets you embed the contents of other wiki pages into your wiki page.
Markup('includewikipage', 'directives', "/\\(:includewikipage\\s+(http:[^$UrlExcludeChars]*?)\\s*:\\)/e", "PRR().implode('',file(str_replace('&','&','$1')))");
Example
(:includewikipage http://www.milwaukeedept.org/pmwiki.php/Main/HomePage?action=source :)
A working example can be viewed at: http://www.milwiki.org/Test/WikiIncludes.
Notes
- For this script to work, you must append ?action=source to the requested URL.
- The included page's markup will be evaluated by your installation of PmWiki. This means that if the included page has cookbook markup not supported by your installation, it will not render properly.
Contributors
- Jeff Barke -> mailto:jbarke [snail] milwaukeedept [period] org, 20051218
Comments
See discussion at IncludeWikiPage-Talk
User notes? : 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.