[pmwiki-users] Fwd: pagelist templates strange behaviour
Jean-Fabrice [gmail]
jeanfabrice at gmail.com
Tue Mar 27 12:26:37 CDT 2007
Patrick,
maybe it's a bug, maybe it's me, but I have some difficulties using
custom defined variable in pagelist fmt. Here is my previous message,
in case you missed it.
In summary, I can't manage to have a working pagelist fmt using a
custom $FmtPV var (specially with the previous / next markup : < and
>)
JF
---------- Forwarded message ----------
From: Jean-Fabrice [gmail] <jeanfabrice at gmail.com>
Date: 24 mars 2007 23:39
Subject: pagelist templates strange behaviour
To: pmwiki-users at pmichaud.com
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}]] | [[{$MonthLink}|{$MonthLinkText}]] | [[{>$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}]] | [[{$MonthLink}|{$MonthLinkText}]] | [[{>$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