[pmwiki-users] Automated WikiTrails.

Dominique Faure dominique.faure at gmail.com
Wed Aug 30 02:10:15 CDT 2006


On 8/30/06, Stirling Westrup <sti at pooq.com> wrote:
> Martin Fick wrote:
> > --- Stirling Westrup <sti at pooq.com> wrote:
> >
> >>> --- Stirling Westrup <sti at pooq.com> wrote:
> >> In the end I did get it all to work though. I added
> >> the following lines
> >> to my local/config.php:
> >>
> >>  global $FmtPV,$pagename,$BaseName;
> >>
> >>  #define a new list=chapters pagelist option.
> >>  $SearchPatterns['chapters'][] = '/-\\d+$/';
> >>
> >>  #Create a new {$BaseName} Page Variable which is
> >> the same as {$Name}
> >>  #but with any trailing '-' part of the name
> >> removed.
> >>  $BaseName =
> >>
> > preg_replace("/-[^-]*$/","",PageVar($pagename,'$Name'));
> >>  $FmtPV['$BaseName'] = '$GLOBALS["BaseName"]';
> >>
> >> Then I created a Stories.GroupHeader containing:
> >>
> >>  (:pagelist name={$BaseName}-* list=chapters
> >> fmt=#trailstory:)
> >
> > That was going to be my next suggestion. :) I think
> > that is a fairly elegant solution for this special
> > purpose problem.  One way to potentially make it
> > slightly more generic would be to use the
> > PageVariablesExtensions recipe with a custom function
> > which can remove the trailing part of the name.
> >
> That's one of the first things I tried. Alas, PageVariableExtensions
> don't play nicely with pagelists or it would have made the job much easier.
>

For the record, I couldn't (for now) made PageVariableExtensions work
with pagelists without modifying the pagelist markup code itself.

But this feature is near the top of my (really too long) tasklist...

Regards,
Dom




More information about the pmwiki-users mailing list