Question
I have an external app that generates html which I publish via a twiki site.The html is included into a TWiki page using:
%-INCLUDE{"%-ATTACHURL%/uidlist.html" raw="on" literal="on"}%
The html contains lots of tables and I want to allow users to comment on the table entries without changing the html itself.
I am trying to add a button to each table which when clicked will either create a new twiki topic into which user comments can be added, or if the topic has already been created, then just append comments.
I can sort of get what I want by using a form within the table:
<-form name="comment" class="buttonstyle" action="%-SCRIPTURLPATH{edit}%/%-WEB%/">
<-input type="hidden" name="action" value="text" />
<-input type="hidden" name="id" value="UID100" />
<-input type="hidden" name="topic" value="projectUID100Comments" />
<-input type="hidden" name="templatetopic" value="projectUIDCommentTemplate" />
<-input type="hidden" name="topicparent" value="-%TOPIC%" />
<-input type="hidden" name="onlywikiname" value="on" />
<-input type="hidden" name="onlynewtopic" value="on" />
<-input type="submit" class="twikiSubmit" value="Add Comment" />
<-/form>
But whenever the button is clicked it always creates a new topic which overwrites any existing topic of the same name (as created by a previous user clicking the Add Comment button).I have played around with the "onlynewtopic" parameter, but it does not seem to change the outcome.
Is what I wish to do possible? If so, please can you direct me how (or where to go look).
Thanks.
Note, I tried replacing the word edit with
%IF{"istopic 'projectUID100Comments'" then="view" else="edit"}
but that ended up generating bad html:
<form name="comment" class="buttonstyle" action="%-SCRIPTURLPATH{view/Sandbox/">
It almost worked though!
I also tried removing the literal="on" from the include line, but this actualy made things worse (rather than better as I had expected).
Environment
--
TonyArmitstead - 27 Nov 2008
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.
Use a custome
CommentPlugin template. See sample applications in the
Sandbox web, such as
EditActionItems and
GenericVote.
--
PeterThoeny - 29 Nov 2008