[pmwiki-users] pagelist and dynamic trail. Any suggestion ?

Jean-Fabrice [gmail] jeanfabrice at gmail.com
Thu Aug 17 15:54:45 CDT 2006


Hi list,

I would like to know if I'm doing the following the right way.

I have a group which contains 2 kinds of page :
- monthly pages, named Group.yyyymm
- daily pages, named Group.yyyymmdd

In a daily page, I have defined a dynamic trail to jump to the
previous day, to the current month and to the next day. I want each
link of the trail to be "human readable" (I don't want to use
$FullName and I can't use $Title).
Eg: < Monday, April 3th 2006 | April 2006 | Wednesday, April 5th 2006 >

Here is how I did this :

1°/ Create variables in config.php to deduce "human readable name"
from page's name :
$FmtPV['$MonthLink'] = 'substr("$name",0,6)'; #To deduce the month page
$FmtPV['$MonthLinkText'] = 'strftime("%B %Y",
mktime(12,0,0,substr("$name",4,2),15,substr("$name",0,4)))'; #To
create a human readable textlink for the month
$FmtPV['$DayLinkText'] = 'strftime("%A %d %B %Y",
mktime(12,0,0,substr("$name",4,2),substr("$name",6,2),substr("$name",0
,4)))'; #To create a human readable textlink for the daily page

2°/ Create a pagelist fmt which make use of these vars :
[[#grouptrail]]
(:if equal {$FullName} {=$FullName}:)<
[[{<$FullName}|{<$DayLinkText}]] | [[{$MonthLink}|{$MonthLinkText}]] |
[[{>$FullName}|{>$DayLinkText}]] >(:if:)
[[#grouptrailend]]

3°/ Insert the trail in the daily page :
(:pagelist fmt=#grouptrail
name={$Group}.????????,-GroupAttributes,-Index,-RecentChanges,-AllRecentChanges,-GroupHeader,-GroupFooter
:)

NB : For the trail, I tried list=normal to get rid of non-usefull
pages, but the trail does not show when doing that.

So :
. is 1°/ the correct / the best "PmWiki way" to do this ?
. have you any opinion on 2°/ (which seems to work correctly)
. can I simplified 3°/ ?

thanks a lot for your help.

Jean-Fabrice




More information about the pmwiki-users mailing list