[pmwiki-users] repost: problem with PTV and if= date in pagelists

none < bergwitz at gmail.com
Fri Jan 30 05:14:09 CST 2009

Audun Myhra Bergwitz wrote:
> Peter Bowers wrote:
>>> Thanks for your help, but I'm no further. I tried all of the above
>>> suggestions, but all I get is a full list of all pages on our wiki.
>> Check your output one more time...  I'm guessing that rather than *all*
>> pages on your wiki you are getting a list of all pages THAT DO NOT HAVE THE
>> PTV SET *combined with* the pages that have the PTV set to a date on or
>> after today.  Because there are so many pages without the PTV set at all it
>> would look like you have all pages being returned.  In other words, I think
>> you will find that the pages with the PTV set to a date earlier than today
>> are *not* being listed there...  (Of course, I'm guessing, but it's worth a
>> shot...)

(:pagelist if='date ..{=$:Timestamp}' $:Timestamp=-:)

Tried this again today, and it works.

The reason it didn't work was that I had PTVs which didn't follow the
correct pattern. I was using the Norwegian word Tid (Time) as the PTV
and some pages had things like "Tid: Monday the 1st of August" (though
in Norwegian so totally unrecognizable for the pmwiki code). When I
tested it by using Timestamp:  as the PTV (which only appear on my test
pages) and all PTVs followed recongizable pattern the code work as expected.

Due to the unrecognizable format of some PTVs the pagelist code seem to
ignore the whole If-thing. I don't know it this is a bug in the code, or
if it is the intended behaviour.

Anyway it makes my idea of making an event calendar based on
PTV-Timestamps somewhat vulnerable, as just one wrongly formatted PTV
will cause all pagelists based on the PTV-timestamp to list everything.
Though, I think I can work around that.

Thanks for all you're help. I'll experiment somemore with the PTVs and
the event calendar, and I'll probably make a Cookbook page on it when I
have good solution.


More information about the pmwiki-users mailing list