Sometimes it's useful to have a highly visible reminder that the page you are viewing is not the latest revision of your topic. It's very simple in TWiki-4 to add a watermark to old revisions as a highly visible reminder, like this:
Whilom ther was dwellynge at oxenford
A riche gnof, that gestes heeld to bord,
And of his craft he was a carpenter.
With hym ther was dwellynge a poure scoler,
Hadde lerned art, but al his fantasye
Was turned for to lerne astrologye,
And koude a certeyn of conclusiouns,
To demen by interrogaciouns,
If that men asked hym in certein houres
Whan that men sholde have droghte or elles shoures,
Or if men asked hym what sholde bifalle
Of every thyng; I may nat rekene hem alle.
-- Main.GeoffreyChaucer - 2 May 1386
TWiki-4 supports something called
context ids, one of which,
inactive, is set when an old revision is viewed. You can use this context id to control a DIV statement.
In your
view.tmpl for your skin (for example,
view.pattern.tmpl), add the following definition (on the first line is fine)
%TMPL:DEF{"watermark"}%style="background:url(%PUBURLPATH%/Custom/Customisations/Watermark.gif)"%TMPL:END%
where
%PUBURLPATH%/Custom/Customisations/Watermark.gif is the URL of your watermark image. You can use the image attached to this topic as an example.
Now find
%TEXT% in the same file. Put a DIV around it, as follows:
<div %TMPL:P{context="inactive" then="watermark"}%> %TEXT% </div>
That will add the watermark on any inactive page, such as when an earlier rev is viewed.
For more on context id's, see TWiki.TWikiTemplates and TWiki.TWikiVariables#VarIF in your installation documentation.
--
Contributors: CrawfordCurrie
Discussion
It appears the sense is wrong on the conditional.
Shouldn't it be written:
<div %TMPL:P{context="inactive" then="watermark"}%> %TEXT% </div>
(ie. When inactive use the watermark for background image)
--
CraigMeyer - 20 Apr 2006
Aha, you found the cunning test I planted to make sure you were paying attention :-/
--
CrawfordCurrie - 20 Apr 2006
CategoryCookbook