RandomIncl

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Question

Is there a way that I can include the text of another page randomly selected from a list of pages?

Answer

Attach:RandomIncl.php

Discussion

This script adds markup of the form [:randomincl PageName:], which includes the text of a page selected at random from a list of pages stored in PageName.

The script also keeps track of which pages have already been selected, so that multiple instances of [:randomincl ...:] in a page will not cause the same page to be displayed twice.

This page has this recipe enabled, so that the markup [:randomincl PmWiki.DocumentationIndex:] randomly selects a page from the PmWiki/DocumentationIndex.

Contributors

  • Pm, 09-July-2004

Example

The following is the text of a page randomly included from the pages listed in PmWiki.DocumentationIndex. Reloading this page will cause different pages to be displayed below.



[:randomincl PmWiki.DocumentationIndex:]

pmwiki-2.3.32 -- Last modified by {{Pm}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons