Question
Hi everyone.
I need to know if current document revision is final and to change topic title accordingly.
I can get current revision by
%REVINFO{"$rev"}%.
But how can I get last revision number of the topic? So than I can add to topic title something
like that:
%IF{'%REVINFO{"$rev"} %<$finalRev' then='<strong>Obsolete revision</strong>'}
So the question is how to get
$finalRev.
Environment
--
EugenePanaitov - 12 Jun 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Possibly include it in from a (html comment) section containing just REVINFO in the "final revision" of the topic?
--
SteffenPoulsen - 16 Jun 2006
How can it be done? How can I distinguish is this topic revision last in history? Is there any way to access history except REVINFO?
--
EugenePanaitov - 25 Jun 2006
A simple search actually seems to go the way for newest revision:
%IF{'%REVINFO{"$rev"}%<%SEARCH{ "%TOPIC%" topic="%TOPIC%" scope="topic" nosearch="on" nototal="on" format="$rev" }%' then='%RED% *THIS VERSION HAS BEEN OBSOLETED* %ENDCOLOR%'}%
Warning goes here in obsoleted revision:
Visit
http://twiki.org/cgi-bin/view/Support/HowToGetIfCurrentRevisionIsLast?rev=6
to see the warning show up.
--
SteffenPoulsen - 27 Jun 2006
Hello, I modified this code to
%IF{'%REVINFO{"$rev"}%<%SEARCH{ "%BASETOPIC%" topic="%BASETOPIC%" scope="topic" nosearch="on" nototal="on" format="$rev" }%' then='<center>%RED% *OBSOLETE REVISION - FOR REFERENCE ONLY* %ENDCOLOR%</center>' else='Any another text here. Revision details: %REVINFO{"r$rev - $date - $time - $wikiusername" topic="%BASEWEB%.%BASETOPIC%"}%'}%
and include this topic in the most of the other topics in the Web, generally it is work well, but I get two problems:
1) I noticed strange bug - Sometimes, If topic had attachments/images It said [code], what revision always obsoleted. I can not get any more precised dependencies.
2) If topic is non-WikiWord this code generate errors;
Example (this shows at point of including):
IF{ "26<" else="Any another text here. Revision details: r3 - 16 Jun 2006 - 14:31:14 - YuryK" then="
OBSOLETE REVISION - FOR REFERENCE ONLY
" }: Missing operand before <
Can anybody help me to fix these problems?
--
YuryKocharyan - 10 Jul 2006
I found answer on first question, should be
%REVINFO{"$rev" topic="%BASEWEB%.%BASETOPIC%"} not as described above.
And I make more detailed research on second item.
--
YuryKocharyan - 13 Jul 2006
Surround the search with
<noautolink></noautolink> tags:
<noautolink>
%IF{'%REVINFO{"$rev"}%<%SEARCH{ "%BASETOPIC%" topic="%BASETOPIC%" scope="topic" nosearch="on" nototal="on" format="$rev" }%' then='<center>%RED% *OBSOLETE REVISION - FOR REFERENCE ONLY* %ENDCOLOR%</center>' else='Any another text here. Revision details: %REVINFO{"r$rev - $date - $time - $wikiusername" topic="%BASEWEB%.%BASETOPIC%"}%'}%
</noautolink>
generates:
Any another text here. Revision details: r10 - 2006-12-19 - 20:55:13 - Main.ArthurClemens
--
ArthurClemens - 19 Dec 2006