[pmwiki-users] Fwd: pagelist templates strange behaviour
Jean-Fabrice [gmail]
jeanfabrice at gmail.com
Tue Mar 27 15:21:04 CDT 2007
2007/3/27, Patrick R. Michaud <pmichaud at pobox.com>:
> Inside of a page variable one can get the name and group by just using $name
> and $group, so a much simpler implementation of the above would be:
>
> $FmtPV['$MonthLink'] = 'substr($name,0,6)';
> $FmtPV['$MonthLinkText'] =
> 'strftime("%B %Y", mktime(12,0,0,substr($name,4,2),15,substr($name,0,4)))';
> $FmtPV['$DayLinkText'] =
> 'strftime("%A %d %B %Y",mktime(12,0,0,substr($name,4,2),substr($name,6,2),substr($name,0,4)))';
Well, I used to use $name but using FmtPageName appeared to me a more
'legal' way. Anyway. I think I have a problem with my configuration
because at the stage of my FmtPV definition, $name appears to be
empty.
What I still don't understand with my original code is why
{<$FullName} render correctly while {$<DayLinktext} gives today and
$<DayLinkText render a strange_formated_but_good result (yesterday)
> Note that {$MonthLink} and {$MonthLinkText} will refer to the page in
> which they are written -- in this case, the page containing your template.
> You probably want {=$MonthLink} or {*$MonthLink} to get things to
> use the name of the page being displayed.
You are right ! thank you for pointed that out.
> I'm also planning to add some date/time formatting routines for pagenames
> directly into the core, which would simplify the above even further.
>
> Pm
>
More information about the pmwiki-users
mailing list