[pmwiki-users] Page text variable arithmetic

Steve Glover steve at fell-services.net
Thu Aug 30 08:54:49 CDT 2007


On Thu, 2007-08-30 at 14:00 +0100, Steve Glover wrote:

> Ah! I didn't realise I could use those to control setting of a page text
> variable. So in general I can have templates that have:
> 
> (:if false:)
> (:if date tomorrow.. "{$Title}" :)
> When: future

Looks like I spoke too soon. I was testing what happened to these pages
before adding this to a whole group...

If I have three pages containing

=START=
(:if false:)
Date: {(ftime fmt="%Y%m%d" when="{$Title}")}
(:if date ..yesterday "{$:Date}" :)
When: past
(:if date today "{$:Date}" :)
When: today
(:if date tomorrow.. "{$:Date}" :)
When: future

This is the {$:When}


==END==

and name them News/2007-08-29-past, News/2007-08-30-present and
News/2007-08-31-future...

I get "This is the future" as text on all three pages, but each page has
appended to it the appropriate one of "When: past", "When: present" or
"When: future" below the end of the page.

This is odd enough, but for the "future" page, the content repeats
itself after the "When: future" bit.

-- 
Steve Glover at                          email: steve at fell-services.net
SDSS, EDINA, University of Edinburgh,          tel: +44 (0)131-650 2908
Causewayside House, 160 Causewayside,          fax: +44 (0)131-650 3308
Edinburgh EH9 1PR                          mobile: +44 (0) 7961 446 902




More information about the pmwiki-users mailing list