This question about Developing extensions (plugins skins etc.): Answered

How to create a link to a specific version of a topic

Hi


I have created a "Change History" by using the CommentPlugin. In the UserCommentsTemplate I have defined the following:
%TMPL:INCLUDE{"view"}%
%TMPL:DEF{"top:toolbarbuttons"}%%TMPL:END% 
%TMPL:DEF{"topicaction"}%%TMPL:END% 
%TMPL:DEF{PROMPT:qmshistory}%
<table>
 <tr>
   <td align="right">Revision:</td>
  <td>
    <input type="text" name="revision" size="8" />
  </td>
 </tr>
 <tr>
   <td align="right">Description:</td>
  <td>
   <textarea name="description"  rows="5" cols="50"></textarea>
  </td>
 </tr>
 <tr>
  <td><input %DISABLED% type="submit" value="Submit History" /></td>
 </tr>
</table>
%TMPL:END%


%TMPL:DEF{OUTPUT:qmshistory}%%POS:BEFORE%|  ([[http://365847.689093.cn/Support/Question968?rev=3][r3]]) |  |  Main.WikiGuest - 01 Dec 2024 |
%TMPL:END%

And in the topics it looks like this (including 1 entry)
| *Revision (Wiki revision)* | *Description* | *Submitted By & Date* |


| A16 ([[%TOPICURL%?rev=%QUERY{ "info.version" }%][r%QUERY{"info.version"}%]]) | Test test.............. |  Main.PeterSvendsen - 04 Nov 2011 |
%COMMENT{type="qmshistory"}%

The issue is now that first time I look at the topic it looks like this:

history-before-rev-change.jpg

Then I continue the work and after some time the wiki update the revision...... and then the history looks like this

history-after-rev-change.jpg

And that was not the idea.... the idea was that A16 (r37) should link so the user can press the r37 and get to that specific version... and when I continue the work and make a new entry in the change history A16 (r37) will still be there and the next one is e.g. A17 (r44)

Could any of you give me a hint where the error may is...

Thanks

Best regards,

Peter
As discussed in IRC, there is no way to get the revision number of the about-to-be-created revision into a topic when it is created. The only macros expanded at this time are: URLPARAM|DATE|(SERVER|GM)TIME|(USER|WIKI)NAME|WIKIUSERNAME|USERINFO)

I believe you are satisfied with a solution using %HISTORY%

-- CrawfordCurrie - 07 Nov 2011

QuestionForm edit

Subject Developing extensions (plugins skins etc.)
Extension
Version Foswiki 1.1.3
Status Answered
Related Topics
I Attachment Action Size Date Who Comment
history-after-rev-change.jpgjpg history-after-rev-change.jpg manage 14 K 04 Nov 2011 - 15:12 PeterSvendsen  
history-before-rev-change.jpgjpg history-before-rev-change.jpg manage 15 K 04 Nov 2011 - 15:12 PeterSvendsen  
Topic revision: r3 - 07 Nov 2011, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy