[pmwiki-users] Pagelists, adjunct data pages & variable sort orders
Patrick R. Michaud
pmichaud at pobox.com
Tue Oct 17 10:28:37 CDT 2006
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.
> Once I do have it working, I guess I could make "stripped" (or "safe")
> pagevar versions and eliminate that custom markup I have for creating
> Category markup?
I don't remember how you're handling categories... but yes, you
may be able to do that.
> I have
> Markup('{$var}', '>$[phrase]',
> '/\\{(\\*|!?[-:\\w.\\/\\x80-\\xff]*)(\\$:?\\w+)\\}/e',
> "htmlspecialchars(PageVar(\$pagename, '$2', '$1'), ENT_NOQUOTES)");
> in my config.php -- I tried commenting it out and my {$:Vars} broke
Yes. You need the custom {$var} rule here because some of your
pages' names have colons in them.
Pm
More information about the pmwiki-users
mailing list