[pmwiki-users] Problem with an pagelist template

Audun Myhra Bergwitz bergwitz at gmail.com
Tue Apr 7 12:23:05 CDT 2009


Kaupert, Guido skrev:
> I want a simple events display. For this matter I added a pagetext variable "EventsDate". I don't want the date in the pagename, because I want to make it very simple to change the data of an event.
> 
> So an "event" looks like this:
> 
> (:EventsDate:2009-05-12:)
> 
> For the pagelist I tried something like this, but sadly it doesn't work. If there are two ore more events in one month, then the heading (in template first) ist repeated for every event. Why?
> 
> [[#EventsList]]
> (:template first {(ftime %Y%m {{=$FullName}$:EventsDate})}:)
> !! {(ftime "%m / %Y" {{=$FullName}$:EventsDate})}
> (:template each:)
> * [[{=$FullName}|{(ftime %d.%m.%Y {{=$FullName}$:EventsDate})} {=$Titlespaced}]]
> [[#EventsListend]]
> 
I think the problem is that the (:template first {(ftime %Y%m
{{=$FullName}$:EventsDate})}:) changes value for each date. So even if
the output (Year Month) stay the same, the actual value changes, and
it's a new first instance.

> I also tried this in the events page:
> 
> (:EventsDate:2009-05-12:)
> (:EventsGroup:{(ftime %Y%m {{=$FullName}$:EventsDate})}:)
> 
Maybe the value of EventsGroup is actually the same as EventsDate, and
not only the ftime output of it.

Did you try this:

> 
> (:EventsDate:2009-05-12:)
> (:EventsGroup:200905:)
> 

[#EventsList]]
(:template first {{=$FullName}$:EventsGroup})}:)
!! {(ftime "%m / %Y" {{=$FullName}$:EventsGroup})}
(:template each:)
* [[{=$FullName}|{(ftime %d.%m.%Y {{=$FullName}$:EventsDate})}
{=$Titlespaced}]]
[[#EventsListend]]


Not sure if it should make a difference to use EventsGroup in the header
insted of EventsDate, but it's worth a try. Making an eventlist is one
of the more difficult uses of PageList, usually it takes a lot of trial
and error. Maybe the documentation should be better.

audun



More information about the pmwiki-users mailing list