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:
- Comment form (using CommentPlugin)
- 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