• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7141: Control over where to add the form tag in comment PROMPT template

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension CommentPlugin Enhancement Closed   patch 5.1.4

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

By default, the CommentPlugin automatically adds the form start tag, form end tag and additional hidden input fields to the comment PROMPT template.

This can be turned of with %COMMENT{ noform="on" }%. However, the hidden input fields are still added to the end. This makes it impossible to define a comment PROMPT template with two forms.

I have a need to add two forms to a PROMPT template:

  1. Comment form (using CommentPlugin)
  2. Notify authors form (using NotifyAuthorsPlugin)

This small enhancement makes it possible to add two or more HTML forms:

The new %COMMENTFORMSTART% and %COMMENTFORMEND% gives one control over where form tags and hidden input templates are added:

  • %COMMENTFORMSTART% - HTML form start tag
  • %COMMENTFORMEND% - hidden input fields and HTML form end tag

If either of these two variables are present in a comment PROMPT template, the form tag is not added automatically.

Example:

%TMPL:DEF{PROMPT:demo}%
<!-- comment form start tag: -->
%COMMENTFORMSTART%
<textarea %DISABLED% rows="%rows|5%" cols="%cols|80%" name="comment" class="twikiTextarea"></textarea>
<div>
<input %DISABLED% type="submit" value="%button|Add comment%" class="twikiButton" />
</div>
<!-- hidden input fields and end form tag: -->
%COMMENTFORMEND%
<!-- second form with notify authors button: -->
%NOTIFYAUTHORS%
%TMPL:END%

-- TWiki:Main/PeterThoeny - 2013-02-10

This is now in SVN trunk and 5.1 branch.

-- TWiki:Main/PeterThoeny - 2013-02-10

ItemTemplate
Summary Control over where to add the form tag in comment PROMPT template
ReportedBy TWiki:Main.PeterThoeny
Codebase ~twiki4, 5.1.3
SVN Range TWiki-5.1.3-trunk, Fri, 11 Jan 2013, build 24780
AppliesTo Extension
Component CommentPlugin
Priority Enhancement
CurrentState Closed
WaitingFor

Checkins TWikirev:24975 TWikirev:24976 TWikirev:24977 TWikirev:24978
TargetRelease patch
ReleasedIn 5.1.4
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2013-02-18 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback