data/TWiki/CommentPluginTemplate.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
child 1 e2915a7cbdfa
permissions -rw-r--r--
RELEASE 4.2.0 freetown
colas@0
     1
%META:TOPICINFO{author="TWikiContributor" date="1166310108" format="1.0" version="4"}%
colas@0
     2
%META:TOPICPARENT{name="CommentPlugin"}%
colas@0
     3
colas@0
     4
---+!! Templates for CommentPlugin
colas@0
     5
colas@0
     6
See [[%TWIKIWEB%.CommentPlugin#Customisation][CommentPlugin: Customisation]] for help.
colas@0
     7
colas@0
     8
While this topic can be viewed as a TWiki topic, it is used by the CommentPlugin as a template file - see TWikiTemplates. The important content in here is in the verbatim blocks. The rest of the topic is just comments.
colas@0
     9
colas@0
    10
%ICON{"hand"}% See CommentPluginExamples to view rendered templates
colas@0
    11
colas@0
    12
<div class="twikiBroadcastMessage" style="background-color:#ffc;">WARNING: THIS FILE WILL BE OVERWRITTEN WHEN YOU UPGRADE THE COMMENT PLUGIN</div>
colas@0
    13
colas@0
    14
Put your local templates into %TWIKIWEB%.UserCommentsTemplate (create if it does not exist yet). *Local templates defined in that topic will override templates defined below.*
colas@0
    15
colas@0
    16
%TOC{title="Table of Contents"}%
colas@0
    17
colas@0
    18
---++ Template definitions
colas@0
    19
---+++ Templates used in rest of file
colas@0
    20
Generic prompt box used by other templates
colas@0
    21
<verbatim>
colas@0
    22
%TMPL:DEF{promptbox}%<div class="commentPlugin commentPluginPromptBox"><table border="0" cellpadding="0" cellspacing="0"><tr valign="middle"><td><textarea %DISABLED% rows="%rows|3%" cols="%cols|70%" name="comment" class="twikiInputField" wrap="soft" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea></td><td>&nbsp;<input %DISABLED% type="submit" value="%button|Add comment%" class="twikiButton" /></td></tr></table></div><!--/commentPlugin-->%TMPL:END%
colas@0
    23
</verbatim>
colas@0
    24
Short comment, signed and dated
colas@0
    25
<verbatim>
colas@0
    26
%TMPL:DEF{outputoneliner}%   * %URLPARAM{"comment"}% -- %WIKIUSERNAME% - %GMTIME{"$day $month $year"}%%TMPL:END%
colas@0
    27
</verbatim>
colas@0
    28
colas@0
    29
%ICON{"hand"}% See rendered template [[CommentPluginExamples#Default][Default]]
colas@0
    30
colas@0
    31
colas@0
    32
colas@0
    33
colas@0
    34
---+++ User templates
colas@0
    35
---++++ top
colas@0
    36
Comments, signed and dated, added at top of file
colas@0
    37
<verbatim>
colas@0
    38
%TMPL:DEF{PROMPT:top}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
    39
</verbatim>
colas@0
    40
colas@0
    41
<verbatim>
colas@0
    42
%TMPL:DEF{OUTPUT:top}%%TMPL:P{outputoneliner}%%POS:TOP%
colas@0
    43
%TMPL:END%
colas@0
    44
</verbatim>
colas@0
    45
colas@0
    46
%ICON{"hand"}% See rendered template [[CommentPluginExamples#top][top]]
colas@0
    47
colas@0
    48
colas@0
    49
colas@0
    50
colas@0
    51
---++++ bottom
colas@0
    52
Comments, signed and dated, added at end of file
colas@0
    53
<verbatim>
colas@0
    54
%TMPL:DEF{PROMPT:bottom}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
    55
</verbatim>
colas@0
    56
<verbatim>
colas@0
    57
%TMPL:DEF{OUTPUT:bottom}%%POS:BOTTOM%%TMPL:P{outputoneliner}%%TMPL:END%
colas@0
    58
</verbatim>
colas@0
    59
colas@0
    60
%ICON{"hand"}% See rendered template [[CommentPluginExamples#bottom][bottom]]
colas@0
    61
colas@0
    62
colas@0
    63
colas@0
    64
colas@0
    65
---++++ above
colas@0
    66
Comments, signed and dated, added immediately before anchor
colas@0
    67
<verbatim>
colas@0
    68
%TMPL:DEF{PROMPT:above}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
    69
</verbatim>
colas@0
    70
<verbatim>
colas@0
    71
%TMPL:DEF{OUTPUT:above}%%POS:BEFORE%%TMPL:P{OUTPUT:threadmode}%%TMPL:END%
colas@0
    72
</verbatim>
colas@0
    73
colas@0
    74
%ICON{"hand"}% See rendered template [[CommentPluginExamples#above][above]]
colas@0
    75
colas@0
    76
colas@0
    77
colas@0
    78
colas@0
    79
---++++ bulletabove
colas@0
    80
Bullet item added immediately before anchor. The input field width is passed with variable =inputsize=, for example:
colas@0
    81
<blockquote><verbatim>
colas@0
    82
%COMMENT{type="bulletabove" inputsize="20"}%
colas@0
    83
</verbatim></blockquote>
colas@0
    84
colas@0
    85
<verbatim>
colas@0
    86
%TMPL:DEF{PROMPT:bulletabove}%<input class="twikiInputField" name="bullet_above_item" id="bullet_above_item" type="text" size="%inputsize|40" value="%URLPARAM{"bullet_above_item"}%" />&nbsp;<input %DISABLED% type="submit" value="%button|Add item%" class="twikiButton" />%TMPL:END%
colas@0
    87
</verbatim>
colas@0
    88
<verbatim>
colas@0
    89
%TMPL:DEF{OUTPUT:bulletabove}%   * %URLPARAM{"bullet_above_item"}%%POS:BEFORE%
colas@0
    90
%TMPL:END%
colas@0
    91
</verbatim>
colas@0
    92
colas@0
    93
%ICON{"hand"}% See rendered template [[CommentPluginExamples#bulletabove][bulletabove]]
colas@0
    94
colas@0
    95
colas@0
    96
colas@0
    97
colas@0
    98
---++++ threadmode
colas@0
    99
Wiki thread mode comment, signed and dated
colas@0
   100
<verbatim>
colas@0
   101
%TMPL:DEF{PROMPT:threadmode}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
   102
</verbatim>
colas@0
   103
<verbatim>
colas@0
   104
%TMPL:DEF{OUTPUT:threadmode}%%POS:BEFORE%
colas@0
   105
colas@0
   106
%URLPARAM{"comment"}%
colas@0
   107
colas@0
   108
-- %WIKIUSERNAME% - %DATE%
colas@0
   109
%TMPL:END%
colas@0
   110
</verbatim>
colas@0
   111
colas@0
   112
%ICON{"hand"}% See rendered template [[CommentPluginExamples#threadmode][threadmode]]
colas@0
   113
colas@0
   114
colas@0
   115
colas@0
   116
colas@0
   117
---++++ belowthreadmode
colas@0
   118
Comments, signed and dated, added recurse after comment box.
colas@0
   119
colas@0
   120
<verbatim>
colas@0
   121
%TMPL:DEF{PROMPT:belowthreadmode}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
   122
</verbatim>
colas@0
   123
<verbatim>
colas@0
   124
%TMPL:DEF{OUTPUT:belowthreadmode}%%POS:AFTER%
colas@0
   125
---++++ %WIKIUSERNAME% - %SERVERTIME%
colas@0
   126
colas@0
   127
%URLPARAM{"comment"}%
colas@0
   128
colas@0
   129
%TMPL:END%
colas@0
   130
</verbatim>
colas@0
   131
colas@0
   132
%ICON{"hand"}% See rendered template [[CommentPluginExamples#belowthreadmode][belowthreadmode]]
colas@0
   133
colas@0
   134
colas@0
   135
colas@0
   136
colas@0
   137
---++++ below
colas@0
   138
Comments, signed and dated, added immediately below anchor
colas@0
   139
<verbatim>
colas@0
   140
%TMPL:DEF{PROMPT:below}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
   141
</verbatim>
colas@0
   142
<verbatim>
colas@0
   143
%TMPL:DEF{OUTPUT:below}%%POS:AFTER%%TMPL:P{outputoneliner}%
colas@0
   144
%TMPL:END%
colas@0
   145
</verbatim>
colas@0
   146
colas@0
   147
%ICON{"hand"}% See rendered template [[CommentPluginExamples#below][below]]
colas@0
   148
colas@0
   149
colas@0
   150
colas@0
   151
colas@0
   152
---++++ tableprepend
colas@0
   153
Comments, signed and dated, added at top of table below the
colas@0
   154
anchor/location/COMMENT
colas@0
   155
<verbatim>
colas@0
   156
%TMPL:DEF{PROMPT:tableprepend}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
   157
</verbatim>
colas@0
   158
<verbatim>
colas@0
   159
%TMPL:DEF{OUTPUT:tableprepend}%%POS:AFTER%| %URLPARAM{"comment" newline="<br />"}% | %WIKIUSERNAME% | %SERVERTIME% |
colas@0
   160
%TMPL:END%
colas@0
   161
</verbatim>
colas@0
   162
colas@0
   163
%ICON{"hand"}% See rendered template [[CommentPluginExamples#tableprepend][tableprepend]]
colas@0
   164
colas@0
   165
colas@0
   166
colas@0
   167
colas@0
   168
---++++ tableappend
colas@0
   169
Comments, signed and dated, added at end of table above the anchor/location/COMMENT
colas@0
   170
<verbatim>
colas@0
   171
%TMPL:DEF{PROMPT:tableappend}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
   172
</verbatim>
colas@0
   173
<verbatim>
colas@0
   174
%TMPL:DEF{OUTPUT:tableappend}%%POS:BEFORE%| %URLPARAM{"comment" newline="<br />"}% | %WIKIUSERNAME% | %SERVERTIME% |
colas@0
   175
%TMPL:END%
colas@0
   176
</verbatim>
colas@0
   177
colas@0
   178
%ICON{"hand"}% See rendered template [[CommentPluginExamples#tableappend][tableappend]]
colas@0
   179
colas@0
   180
colas@0
   181
colas@0
   182
colas@0
   183
---++++ after: Add before the comment box, after the last comment
colas@0
   184
<verbatim>
colas@0
   185
%TMPL:DEF{PROMPT:after}%%TMPL:P{promptbox}%%TMPL:END%
colas@0
   186
</verbatim>
colas@0
   187
<verbatim>
colas@0
   188
%TMPL:DEF{OUTPUT:after}%%NOP%%TMPL:P{outputoneliner}%
colas@0
   189
%POS:BEFORE%%TMPL:END%
colas@0
   190
</verbatim>
colas@0
   191
colas@0
   192
%ICON{"hand"}% See rendered template [[CommentPluginExamples#after][after]]
colas@0
   193
colas@0
   194
colas@0
   195
colas@0
   196
colas@0
   197
---++++ action
colas@0
   198
Action added to action table directly above comment box
colas@0
   199
(requires TWiki:Plugins/ActionTrackerPlugin)
colas@0
   200
<verbatim>
colas@0
   201
%TMPL:DEF{PROMPT:action}%
colas@0
   202
colas@0
   203
%TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
colas@0
   204
|        <label for="action_who">Action for</label>| <input class="twikiInputField" name="action_who" id="action_who" type="text" size="50" value="%URLPARAM{"who"}%" /> |
colas@0
   205
| <label for="action_due">Due date</label>| <input class="twikiInputField" name="action_due" id="action_due" type="text" size="30" value="%URLPARAM{"due"}%" /> |
colas@0
   206
|    <label for="action_comment">Comment</label>| <textarea %DISABLED% rows="%rows|3%" cols="%cols|50%" name="action_comment" id="action_comment" class="twikiInputField" wrap="soft" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea> |
colas@0
   207
|| <input %DISABLED% type="submit" class="twikiButton" value="Add action" /> |
colas@0
   208
%TMPL:END%
colas@0
   209
</verbatim>
colas@0
   210
<verbatim>
colas@0
   211
%TMPL:DEF{OUTPUT:action}%%POS:BEFORE%%AC%NOP%TION{who="%URLPARAM{"action_who"}%" due="%URLPARAM{"action_due"}%"}% %URLPARAM{"action_comment" newline="<br />"}%<br />- Created by %WIKIUSERNAME%, %SERVERTIME%
colas@0
   212
%TMPL:END%
colas@0
   213
</verbatim>
colas@0
   214
colas@0
   215
%ICON{"hand"}% See rendered template [[CommentPluginExamples#action][action]]
colas@0
   216
colas@0
   217
colas@0
   218
colas@0
   219
colas@0
   220
---++++ table
colas@0
   221
Tablerows adding on end - TWiki:Main/FranzJosefSilli
colas@0
   222
<verbatim>
colas@0
   223
%TMPL:DEF{PROMPT:table}%
colas@0
   224
%TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
colas@0
   225
|        <label for="comment_date">Date</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_date" id="comment_date" /> |
colas@0
   226
|        <label for="comment_city">City</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_city" id="comment_city" value="" /> |
colas@0
   227
|| <input %DISABLED% type="submit" class="twikiButton" value="%button|Add entry%" /> |
colas@0
   228
%TMPL:END%
colas@0
   229
</verbatim>
colas@0
   230
<verbatim>
colas@0
   231
%TMPL:DEF{OUTPUT:table}%%POS:BEFORE%| %URLPARAM{"comment_date"}% | %WIKIUSERNAME% | %URLPARAM{"comment_city" }% |
colas@0
   232
%TMPL:END%
colas@0
   233
</verbatim>
colas@0
   234
colas@0
   235
%ICON{"hand"}% See rendered template [[CommentPluginExamples#table][table]]
colas@0
   236
colas@0
   237
colas@0
   238
colas@0
   239
colas@0
   240
---++++ toctalk
colas@0
   241
Talk using TOC adding on end - TWiki:Main/FranzJosefSilli
colas@0
   242
<verbatim>
colas@0
   243
%TMPL:DEF{PROMPT:toctalk}%
colas@0
   244
%TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
colas@0
   245
|        <label for="comment_summary">Summary</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_summary" id="comment_summary" /> |
colas@0
   246
|        <label for="toctalk_comment_text">Message</label>| <textarea %DISABLED% rows="%rows|3%" cols="%cols|50%" name="toctalk_comment_text" id="toctalk_comment_text" class="twikiInputField" wrap="soft" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea> |
colas@0
   247
|| <input %DISABLED% type="submit" value="%button|Add%" class="twikiButton" /> |
colas@0
   248
%TMPL:END%
colas@0
   249
</verbatim>
colas@0
   250
<verbatim>
colas@0
   251
%TMPL:DEF{OUTPUT:toctalk}%
colas@0
   252
%POS:BEFORE%---++++ %SERVERTIME% %WIKIUSERNAME%: %URLPARAM{"comment_summary"}%
colas@0
   253
%POS:BEFORE%%URLPARAM{"toctalk_comment_text" }%
colas@0
   254
%POS:BEFORE%
colas@0
   255
%TMPL:END%
colas@0
   256
</verbatim>
colas@0
   257
colas@0
   258
%ICON{"hand"}% See rendered template [[CommentPluginExamples#toctalk][toctalk]]
colas@0
   259
colas@0
   260
colas@0
   261
colas@0
   262
colas@0
   263
---++++ bookmark
colas@0
   264
Create a list of annotated bookmarks - TWiki:Main/FranzJosefSilli
colas@0
   265
<verbatim>
colas@0
   266
%TMPL:DEF{PROMPT:bookmark}%
colas@0
   267
%TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
colas@0
   268
|        <label for="comment_url">Url</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_url" id="comment_url" value="http://" /> |
colas@0
   269
| <label for="comment_link">Link label</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_link" id="comment_link" /> |
colas@0
   270
|    <label for="bookmark_comment_text">Comment</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="bookmark_comment_text" id="bookmark_comment_text" value="%MESSAGE%" /> |
colas@0
   271
|| <input %DISABLED% type="submit" value="%button|Add bookmark%" class="twikiButton" /> |
colas@0
   272
%TMPL:END%
colas@0
   273
</verbatim>
colas@0
   274
<verbatim>
colas@0
   275
%TMPL:DEF{OUTPUT:bookmark}%%POS:BEFORE%   * [[%URLPARAM{"comment_url" encode="entity"}%][%URLPARAM{"comment_link" encode="entity"}%]] %IF{" '%URLPARAM{"bookmark_comment_text" encode="entity"}%' = '' " then="" else="- "}%%URLPARAM{"bookmark_comment_text" encode="entity"}%
colas@0
   276
%TMPL:END%
colas@0
   277
</verbatim>
colas@0
   278
colas@0
   279
%ICON{"hand"}% See rendered template [[CommentPluginExamples#bookmark][bookmark]]
colas@0
   280
colas@0
   281
colas@0
   282
colas@0
   283
colas@0
   284
---++++ return
colas@0
   285
Post to a different topic and return to here. The comment =target= is set in the =PROMPT=. In the form below the =redirectto= is set to the current (including) topic. %RED% Available with TWiki 4.1. %ENDCOLOR%
colas@0
   286
colas@0
   287
<verbatim>
colas@0
   288
%TMPL:DEF{returnpromptbox}%
colas@0
   289
<input type="hidden" name="redirectto" value="%BASEWEB%.%BASETOPIC%" />
colas@0
   290
%TMPL:P{promptbox}%
colas@0
   291
%TMPL:END%
colas@0
   292
</verbatim>
colas@0
   293
<verbatim>
colas@0
   294
%TMPL:DEF{PROMPT:return}%%TMPL:P{returnpromptbox}%%TMPL:END%
colas@0
   295
</verbatim>
colas@0
   296
<verbatim>
colas@0
   297
%TMPL:DEF{OUTPUT:return}%%POS:BEFORE%%TMPL:P{OUTPUT:threadmode}%%TMPL:END%
colas@0
   298
</verbatim>
colas@0
   299
colas@0
   300
%ICON{"hand"}% See rendered template [[CommentPluginExamples#return][return]]
colas@0
   301
colas@0
   302
colas@0
   303
colas@0
   304
colas@0
   305
---++ Include !UserComments
colas@0
   306
colas@0
   307
Including UserComments:
colas@0
   308
colas@0
   309
%TMPL:INCLUDE{"UserComments"}%