[pmwiki-users] Pagelist {$$option} does not accept page variable value?

Roman romat2 at gmail.com
Thu Mar 22 17:01:41 CDT 2007


I'll demonstrate my problem on my parcticular case which, I think,
could be useful for others.

I have a group of pages, each page has a page text variable (PTV)
called Date which holds a value of date in ISO format. (Just for
explanation, I can't use neither page creation date nor page
modification date for this purpose.)

I want to create a pagelist of pages with value of PTV Date within
last seven days. So I created these two page variables

$FmtPV['$TodayISO'] = 'date("Y-m-d")';
$FmtPV['$SevenDaysAgoISO'] = 'date("Y-m-d",
mktime(0,0,0,date("m"),date("d")-7,date("Y")))';

Because pagelist directive does not support ranges of PTVs (like
$:Date={$SevenDaysAgoISO}..{$$TodayISO}) I defined pagelist template
with the help of ConditionalExtensions recipe this way:

[[#Last7Days]]
(:if [ ( gt {{=$FullName}$:Date} {$$startdate} ) && ( le
{{=$FullName}$:Date} {$$enddate} ) ] :)
(:include {=$FullName} self=0:)
(:ifend:)
[[#Last7DaysEnd]]

It works when I use literal date values, for example
(:pagelist group=MyGroup fmt=#Last7Days startdate=2007-03-15
enddate=2007-03-22:)

but does not work when I use page variables values
(:pagelist group=MyGroup fmt=#Last7Days startdate={$TodayISO}
enddate={$SevenDaysAgoISO}:)

It looks like pagelist {$$option} does not accept page variable value.
Since there is a lot of progress these days in pagelist code I am
asking if there is a chance to add this possibility?

Roman



More information about the pmwiki-users mailing list