[pmwiki-users] Conditional results in (:pagelist:)

Patrick R. Michaud pmichaud at pobox.com
Thu Feb 22 16:31:40 CST 2007


On Thu, Feb 22, 2007 at 10:18:31PM +0000, Iain D. Brown wrote:
> I am producing a site that contains pages with information about
> events, exhibitions and workshops, which are spread across three
> Groups. On my main Events homepage (Events.Events), I am trying to
> use pagelists to produce a list from across all three Groups.
>         
> At the top of each relevant page, I have included the tag
> (:enddate: DATE :), where DATE is the last date of the event in
> the format YYYMMDD.
> 
> I can get the pagelist directive to produce a list if I include an
> explicit date: (:pagelist $:enddate=20070723
> group=Events,Community,International order=-$:enddate :) but what I
> really want to do is get the pagelist directive to take today's
> date, and it is greater than $:enddate then not to return that page
> in the listing. Alternatively, if the $:enddate has not yet passed,
> then return the page. I guess it will involve conditional
> variables or some such.

Within the current version of PmWiki, you would need to load
the ConditionalExtensions recipe, and then create a template
that can do:

    (:if ge {=$:enddate} $TodayDate:)
    ... display record ...

The (:pagelist:) command itself doesn't know how to do
relational conditions such as >, >=, etc... so those have
to be done within the template.

Pm



More information about the pmwiki-users mailing list