[pmwiki-users] Pagelist question

Stirling Westrup sti at pooq.com
Sun May 11 13:44:06 CDT 2008

Jan Erik Moström wrote:
> I'm trying to implement some kind of blog feature (yes, I know 
> there are several suggestions for how to do this ... see this as 
> an exercise in learning more about pmwiki). I'm trying to keep 
> things as simple as possible and base everything on the pagelist 
> command, on thing I'm trying to implement is "future post". In 
> other words I want to be able to write and post an entry that 
> shouldn't appear until some future day.
> I've got one entry/page and they all have the format 
> YYYYMMDDHHMMSS. My idea was to let pagelist only list the pages 
> that have names that are less or equal that the current date/time.
> I've been looking at the pagelist page but can't see any option 
> that would allow me to do this kind of listing. Then I tried to 
> figure out if I could make a list format that would do this, but 
> looking at ConditionalMarkup I'm unsure on how I should do.
> I would be grateful for a hint on how to solve thise

The standard way would be to use the if= parameter of pagelist, coupled
with a date test. Something like this:

(:pagelist group=BLOG if="date ..{(ftime %F)} {=$Name}" :)

That should list all the pages in the blog group, which when interpreted
as a date, are before the current date.

Hmm. Come to think of it, I'm not sure that date will accept both date
AND time. You may need to truncate the value of {=$Name} to get the
above to work. Maybe we need

(:if time ... :) or (:if datetime ... :)

conditionals as well? They shouldn't be hard to write.

More information about the pmwiki-users mailing list