[pmwiki-users] Create a Wiki Trail from dynamic pages

John Rankin john.rankin at affinity.co.nz
Fri Nov 4 14:55:17 CST 2005

On Saturday, 5 November 2005 2:50 AM, Crisp, Steve [UK] <SCRISP at ngms.eu.com> wrote:
>Dear PmWiki community,
>I would like to be able to create a Trail from a dynamic Wiki
>page.  I57;ve looked at the DynamicTrail recipe but this is not
>the same thing (I think).  An example is best here.  Let57;s
>assume I have a page called DynamicPage which contains the following Wiki mark-up:
>! This is a dynamic page
>(:include ThisPage lines=5..:)
>(:include AnotherPage:)
>Consider that the pages 56;included57; above may contain a few
>bulleted lists - the above page wraps other content.  I would
>like to be able to point a Wiki trail at my DynamicPage.
>I would be greatful is someone could let me know how to do this?

You'll need to create a modified version of scripts/trails.php
in your local/ directory.

After that script reads the page, but before it  explodes the content
into lines, you'll need to match \\(:include\\s+(\\S.*?):\\)  and
process the result through the IncludeText($pagename, '$1')

Something like

$trailpage['text'] = preg_replace('/\\(:include\\s+(\\S.*?):\\)/ei', 
    "IncludeText($pagename, '$1')",$trailpage['text']);

This is off the top of my head, so is probably not quite right.

If this 'implementation details are left as an exercise for the reader' 
hint is not enough, let me know and we'll look more closely at what's needed.

John Rankin

More information about the pmwiki-users mailing list