[pmwiki-users] pagelist templates strange behaviour

Jean-Fabrice [gmail] jeanfabrice at gmail.com
Sat Mar 24 16:39:14 CDT 2007


Hi,

I used to use a pagelist templates to produce a trail in a group like that :
<< Monday February 4th 2007 || February 2007 || Wednesday February 6th 2007 >>

(according you are viewing the page corresponding to Tuesday February 5th 2007)
Page name are of the form Group.YYYYMMDD

Here is the fmt I use :
[[#dailytrail]]
(:if equal {*$FullName} {=$FullName}:)[[{<$FullName}|<<
{<$DayLinkText}]]&nbsp;&nbsp;|&nbsp;&nbsp;[[{$MonthLink}|{$MonthLinkText}]]&nbsp;&nbsp;|&nbsp;&nbsp;[[{>$FullName}|{>$DayLinkText}>>]](:if:)
[[#dailytrailend]]

I then defined the following variables :
$FmtPV['$MonthLink'] = 'substr(FmtPageName(\'$Name\',$pagename),0,6)';
$FmtPV['$MonthLinkText'] = 'strftime("%B %Y",
mktime(12,0,0,substr(FmtPageName(\'$Name\',$pagename),4,2),15,substr(FmtPageName(\'$Name\',$pagename),0,4)))';
$FmtPV['$DayLinkText'] = 'strftime("%A %d %B %Y",
mktime(12,0,0,substr(FmtPageName(\'$Name\',$pagename),4,2),substr(FmtPageName(\'$Name\',$pagename),6,2),substr(FmtPageName(\'$Name\',$pagename),0,4)))';

This used to work fine but it doesn't anymore. Left and right links
are correct (they link to the previous/next day) but the text of the
link is wrong. The text printed for {<$DayLinkText} and
{>$dayLinkText} is ... the current day :
<< Tuesday February 5th 2007 || February 2007 || Tuesday February 65th 2007 >>

If I change the fmt for (notice the non standard lack of '{' and '}'
arround $DayLinkText),
[[#dailytrail]]
(:if equal {*$FullName} {=$FullName}:)[[{<$FullName}|<<
{<$DayLinkText}]]&nbsp;&nbsp;|&nbsp;&nbsp;[[{$MonthLink}|{$MonthLinkText}]]&nbsp;&nbsp;|&nbsp;&nbsp;[[{>$FullName}|{>$DayLinkText}>>]](:if:)
[[#dailytrailend]]

Here is what I get :
<< <Monday February 4th 2007 || February 2007 || Wednesday February 6th 2007> >>

Am I doing something wrong ?

JF



More information about the pmwiki-users mailing list