[pmwiki-users] Pagelists, adjunct data pages & variable sort orders
Dominique Faure
dominique.faure at gmail.com
Wed Oct 18 04:56:24 CDT 2006
On 10/17/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Tue, Oct 17, 2006 at 04:30:59AM -0400, Crisses wrote:
> > On Oct 17, 2006, at 2:55 AM, Patrick R. Michaud wrote:
> > > $FmtPV['$Year'] =
> > > "PageTextVar('Data-'.PageVar(\$pn, '\$BaseName'), '$:Year')";
> > > $FmtPV['$Work'] =
> > > "PageTextVar('Data-'.PageVar(\$pn, '\$BaseName'), '$:Work')";
> > > $FmtPV['$WAuthor'] =
> > > "PageTextVar('Data-'.PageVar(\$pn, '\$BaseName'), '$:WAuthor')";
>
> > This didn't work....
> > I tried it out by putting
> > {$Year}
> > {$WAuthor}
> > {$Work}
> > in the body of a Simile page, and nothing is coming back from it. I don't
> > see why the code isn't creating output though. Am I calling the page
> > variables correctly?
>
> Oh, sorry, I had the second argument to PageTextVar() incorrect --
> the $: should be omitted from the argument. Try the following instead
> (tested on pmwiki.org):
>
> $FmtPV['$Year'] =
> "PageTextVar('Data-'.MakeBaseName(\$pn), 'Year')";
>
> $FmtPV['$Work'] =
> "PageTextVar('Data-'.MakeBaseName(\$pn), 'Work')";
>
> $FmtPV['$WAuthor'] =
> "PageTextVar('Data-'.MakeBaseName(\$pn), 'WAuthor')";
>
> I've also replaced the recursive call to PageVar(...) with
> a direct call to MakeBaseName() -- this should also be an
> improvement.
>
Couldn't this being "automated" in the (:pagelist:) directive?
Having the
$FmtPV['$MyVar'] = "PageTextVar(MakeBaseName(\$pn), 'MyVar')";
being done when a variable reference is detected during the
order=...,$MyVar,... option parsing.
Dom
More information about the pmwiki-users
mailing list