[pmwiki-users] Problem with an pagelist template

Kaupert, Guido Guido.Kaupert at brose.com
Thu Apr 16 00:12:39 CDT 2009


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 anevent.

So an "event" looks like this:

(:Events: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}$:Events})}:)
!! {(ftime "%m / %Y" {{=$FullName}$:Events})}
(:template each:)
* [[{=$FullName}|{(ftime %d.%m.%Y {{=$FullName}$:Events})}
{=$Titlespaced}]]
[[#EventsListend]]

I also tried this in the events page:

(:Events:2009-05-12:)
(:EventsGroup:{(ftime %Y%m {{=$FullName}$:Events})}:)

and this for the template:

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

and even this:

(:Events:2009-05-12:)
(:EventsGroup:200905:)

The result is always the same:

03 / 2009
02.03.2009 Dies ist ein vergangener Termin 
04 / 2009
10.04.2009 Termin f?r den April 
04 / 2009
17.04.2009 Geburtstag 
05 / 2009
10.05.2009 Dies ist ein zuk?nftiger Termin 

Note that 04 / 2009 is twice in the list!

The pagelist ist always the same:

(:pagelist group=-Site* $:Events=- fmt=#EventsList order=$:Events:)






I tried now this version and it works fine! Is there an error with the
template first ?


[[#EventsList]]
(:if ! equal {(ftime %Y%m {{<$FullName}$:Events})} {(ftime %Y%m
{{=$FullName}$:Events})} :)
!! {(ftime "%m / %Y" {{=$FullName}$:Events})}
(:ifend:)
(:template each:)
* [[{=$FullName}|{(ftime %d.%m.%Y {{=$FullName}$:Events})}
{=$Titlespaced}]]
[[#EventsListend]]



Thanks,

Guido



More information about the pmwiki-users mailing list