Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

IncludeWikiPage

Summary: How to syndicate wiki pages from other PmWiki 2.0 sites on your site
Version: 20051218
Prerequisites: Requires at least PmWiki version: PmWiki 2.0; last tested on PmWiki version: PmWiki 2.0.12
Status:
Maintainer: Jeff Barke
Category: Includes

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 and Comments

  1. For this script to work, you must append ?action=source to the requested URL.
  2. 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


  • Is it possible to extend it to use (:includewikipage http://...HomePage?action=source#from#to:) to display only a part of the included WikiPage?
  • Where there is a div, eg >>font-size=small<<, in a page, the div is not recognised, see http://www.milwiki.org/Test/WikiIncludes. PmWiki appears to generate the following <p> in front of >> causing the div markup not to be at the start of the line and thus not picked up, vis <p>>>.
  • Also appears to have problems with -> and -< markup
Edit - History - Print - Recent Changes - Search
Page last modified on December 12, 2007, at 05:06 PM