[Pmwiki-users] wikitrails from pagelist

Val Sharp val
Sun Nov 14 17:15:20 CST 2004


I'm trying to find a way to derive wikitrails from a (:pagelist...:) 
list on an index page.

However, the ReadPage function called from the trails script is 
returning the pagelist directive itself as the contents of the page, 
rather than the list that the pagelist is intended to generate.

So I thought of two ways of perhaps achieving what I want:

1. with the pagelist directive on an index page, after '$trailpage = 
ReadPage($trailname);', by examining $trailpage in function ReadTrail 
in trails.php for the pagelist directive and calling function 
FmtPageList before proceeding, or

2. by instead allowing :pagelist...: inside the trails directive, e.g. 
<<|:pagelist....:|>>, and examining for this in $trailname in function 
ReadTrail in trails.php, and then calling function FmtPageList before 
proceeding.

But I'm having trouble figuring out the required parameters for 
function FmtPageList ... for example, in the second case I was trying 
something like

function ReadTrail($pagename,$trailname) {
   global $SuffixPattern,$GroupPattern,$WikiWordPattern,$LinkWikiWords;

if (substr($trailname,0,9) == ":pagelist") {
   $trailpage = preg_replace('/\\:pagelist\\s*(.*)\\:/e',
   "FmtPageList('\$MatchList',\$pagename,array('o'=>PSS('$1 
')))",$trailname);
}

which works as far as calling FmtPageList, but the rest is a mess. I 
don't even know if this is feasible.
(I also have no idea if I need to include the Keep function, as in

$trailpage = preg_replace('/\\:pagelist\\s*(.*)\\:/e',
   "Keep(FmtPageList('\$MatchList',\$pagename,array('o'=>PSS('$1 
'))))",$trailname);)

Can anyone help here?


-- 
Best regards,
Val



More information about the pmwiki-users mailing list