Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS: Windows XP sp 3
Web Browser: Firefox 3.0.4
Categories: Forms

-- TonyArmitstead - 27 Nov 2008

Answer

ALERT! 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

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-11-29 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.