Revert
[openafs-wiki.git] / TWiki / CommentPluginTemplate.mdwn
1 # <a name="Templates for _CommentPlugin"></a><a name=" Templates for _CommentPlugin"></a> Templates for [[CommentPlugin]]
2
3 See [[CommentPlugin: Customisation|TWiki/CommentPlugin#Customisation]] for help.
4
5 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.
6
7 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See [[CommentPluginExamples]] to view rendered templates
8
9 <div style="background-color: #ffc">WARNING: THIS FILE WILL BE OVERWRITTEN WHEN YOU UPGRADE THE COMMENT PLUGIN</div>
10
11 Put your local templates into [[UserCommentsTemplate]] (create if it does not exist yet). **Local templates defined in that topic will override templates defined below.**
12
13 <div><span>Table of Contents</span><ul>
14     <li><a href="#Template definitions"> Template definitions</a><ul>
15         <li><a href="#Templates used in rest of file"> Templates used in rest of file</a></li>
16         <li><a href="#User templates"> User templates</a><ul>
17             <li><a href="#top"> top</a></li>
18             <li><a href="#bottom"> bottom</a></li>
19             <li><a href="#above"> above</a></li>
20             <li><a href="#bulletabove"> bulletabove</a></li>
21             <li><a href="#threadmode"> threadmode</a></li>
22             <li><a href="#belowthreadmode"> belowthreadmode</a></li>
23             <li><a href="#below"> below</a></li>
24             <li><a href="#tableprepend"> tableprepend</a></li>
25             <li><a href="#tableappend"> tableappend</a></li>
26             <li><a href="#after: Add before the comment bo"> after: Add before the comment box, after the last comment</a></li>
27             <li><a href="#action"> action</a></li>
28             <li><a href="#table"> table</a></li>
29             <li><a href="#toctalk"> toctalk</a></li>
30             <li><a href="#bookmark"> bookmark</a></li>
31             <li><a href="#return"> return</a></li>
32           </ul>
33         </li>
34       </ul>
35     </li>
36     <li><a href="#Include _UserComments"> Include UserComments</a></li>
37   </ul>
38 </div>
39
40 ## <a name="Template definitions"></a> Template definitions
41
42 ### <a name="Templates used in rest of file"></a> Templates used in rest of file
43
44 Generic prompt box used by other templates
45
46     %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%
47
48 Short comment, signed and dated
49
50     %TMPL:DEF{outputoneliner}%   * %URLPARAM{"comment"}% -- %WIKIUSERNAME% - %GMTIME{"$day $month $year"}%%TMPL:END%
51
52 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[Default|Main/CommentPluginExamples#Default]]
53
54 ### <a name="User templates"></a> User templates
55
56 #### <a name="top"></a> top
57
58 Comments, signed and dated, added at top of file
59
60     %TMPL:DEF{PROMPT:top}%%TMPL:P{promptbox}%%TMPL:END%
61
62     %TMPL:DEF{OUTPUT:top}%%TMPL:P{outputoneliner}%%POS:TOP%
63     %TMPL:END%
64
65 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[top|Main/CommentPluginExamples#top]]
66
67 #### <a name="bottom"></a> bottom
68
69 Comments, signed and dated, added at end of file
70
71     %TMPL:DEF{PROMPT:bottom}%%TMPL:P{promptbox}%%TMPL:END%
72
73     %TMPL:DEF{OUTPUT:bottom}%%POS:BOTTOM%%TMPL:P{outputoneliner}%%TMPL:END%
74
75 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[bottom|Main/CommentPluginExamples#bottom]]
76
77 #### <a name="above"></a> above
78
79 Comments, signed and dated, added immediately before anchor
80
81     %TMPL:DEF{PROMPT:above}%%TMPL:P{promptbox}%%TMPL:END%
82
83     %TMPL:DEF{OUTPUT:above}%%POS:BEFORE%%TMPL:P{OUTPUT:threadmode}%%TMPL:END%
84
85 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[above|Main/CommentPluginExamples#above]]
86
87 #### <a name="bulletabove"></a> bulletabove
88
89 Bullet item added immediately before anchor. The input field width is passed with variable `inputsize`, for example:
90
91 > %COMMENT{type="bulletabove" inputsize="20"}%
92
93     %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%
94
95     %TMPL:DEF{OUTPUT:bulletabove}%   * %URLPARAM{"bullet_above_item"}%%POS:BEFORE%
96     %TMPL:END%
97
98 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[bulletabove|Main/CommentPluginExamples#bulletabove]]
99
100 #### <a name="threadmode"></a> threadmode
101
102 Wiki thread mode comment, signed and dated
103
104     %TMPL:DEF{PROMPT:threadmode}%%TMPL:P{promptbox}%%TMPL:END%
105
106     %TMPL:DEF{OUTPUT:threadmode}%%POS:BEFORE%
107
108     %URLPARAM{"comment"}%
109
110     -- %WIKIUSERNAME% - %DATE%
111     %TMPL:END%
112
113 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[threadmode|Main/CommentPluginExamples#threadmode]]
114
115 #### <a name="belowthreadmode"></a> belowthreadmode
116
117 Comments, signed and dated, added recurse after comment box.
118
119     %TMPL:DEF{PROMPT:belowthreadmode}%%TMPL:P{promptbox}%%TMPL:END%
120
121     %TMPL:DEF{OUTPUT:belowthreadmode}%%POS:AFTER%
122     ---++++ %WIKIUSERNAME% - %SERVERTIME%
123
124     %URLPARAM{"comment"}%
125
126     %TMPL:END%
127
128 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[belowthreadmode|Main/CommentPluginExamples#belowthreadmode]]
129
130 #### <a name="below"></a> below
131
132 Comments, signed and dated, added immediately below anchor
133
134     %TMPL:DEF{PROMPT:below}%%TMPL:P{promptbox}%%TMPL:END%
135
136     %TMPL:DEF{OUTPUT:below}%%POS:AFTER%%TMPL:P{outputoneliner}%
137     %TMPL:END%
138
139 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[below|Main/CommentPluginExamples#below]]
140
141 #### <a name="tableprepend"></a> tableprepend
142
143 Comments, signed and dated, added at top of table below the anchor/location/COMMENT
144
145     %TMPL:DEF{PROMPT:tableprepend}%%TMPL:P{promptbox}%%TMPL:END%
146
147     %TMPL:DEF{OUTPUT:tableprepend}%%POS:AFTER%| %URLPARAM{"comment" newline="<br />"}% | %WIKIUSERNAME% | %SERVERTIME% |
148     %TMPL:END%
149
150 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[tableprepend|Main/CommentPluginExamples#tableprepend]]
151
152 #### <a name="tableappend"></a> tableappend
153
154 Comments, signed and dated, added at end of table above the anchor/location/COMMENT
155
156     %TMPL:DEF{PROMPT:tableappend}%%TMPL:P{promptbox}%%TMPL:END%
157
158     %TMPL:DEF{OUTPUT:tableappend}%%POS:BEFORE%| %URLPARAM{"comment" newline="<br />"}% | %WIKIUSERNAME% | %SERVERTIME% |
159     %TMPL:END%
160
161 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[tableappend|Main/CommentPluginExamples#tableappend]]
162
163 #### <a name="after: Add before the comment bo"></a> after: Add before the comment box, after the last comment
164
165     %TMPL:DEF{PROMPT:after}%%TMPL:P{promptbox}%%TMPL:END%
166
167     %TMPL:DEF{OUTPUT:after}%%NOP%%TMPL:P{outputoneliner}%
168     %POS:BEFORE%%TMPL:END%
169
170 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[after|Main/CommentPluginExamples#after]]
171
172 #### <a name="action"></a> action
173
174 Action added to action table directly above comment box (requires TWiki:Plugins/ActionTrackerPlugin)
175
176     %TMPL:DEF{PROMPT:action}%
177
178     %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
179     |        <label for="action_who">Action for</label>| <input class="twikiInputField" name="action_who" id="action_who" type="text" size="50" value="%URLPARAM{"who"}%" /> |
180     | <label for="action_due">Due date</label>| <input class="twikiInputField" name="action_due" id="action_due" type="text" size="30" value="%URLPARAM{"due"}%" /> |
181     |    <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> |
182     || <input %DISABLED% type="submit" class="twikiButton" value="Add action" /> |
183     %TMPL:END%
184
185     %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%
186     %TMPL:END%
187
188 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[action|Main/CommentPluginExamples#action]]
189
190 #### <a name="table"></a> table
191
192 Tablerows adding on end - TWiki:Main/FranzJosefSilli
193
194     %TMPL:DEF{PROMPT:table}%
195     %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
196     |        <label for="comment_date">Date</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_date" id="comment_date" /> |
197     |        <label for="comment_city">City</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_city" id="comment_city" value="" /> |
198     || <input %DISABLED% type="submit" class="twikiButton" value="%button|Add entry%" /> |
199     %TMPL:END%
200
201     %TMPL:DEF{OUTPUT:table}%%POS:BEFORE%| %URLPARAM{"comment_date"}% | %WIKIUSERNAME% | %URLPARAM{"comment_city" }% |
202     %TMPL:END%
203
204 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[table|Main/CommentPluginExamples#table]]
205
206 #### <a name="toctalk"></a> toctalk
207
208 Talk using TOC adding on end - TWiki:Main/FranzJosefSilli
209
210     %TMPL:DEF{PROMPT:toctalk}%
211     %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
212     |        <label for="comment_summary">Summary</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_summary" id="comment_summary" /> |
213     |        <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> |
214     || <input %DISABLED% type="submit" value="%button|Add%" class="twikiButton" /> |
215     %TMPL:END%
216
217     %TMPL:DEF{OUTPUT:toctalk}%
218     %POS:BEFORE%---++++ %SERVERTIME% %WIKIUSERNAME%: %URLPARAM{"comment_summary"}%
219     %POS:BEFORE%%URLPARAM{"toctalk_comment_text" }%
220     %POS:BEFORE%
221     %TMPL:END%
222
223 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[toctalk|Main/CommentPluginExamples#toctalk]]
224
225 #### <a name="bookmark"></a> bookmark
226
227 Create a list of annotated bookmarks - TWiki:Main/FranzJosefSilli
228
229     %TMPL:DEF{PROMPT:bookmark}%
230     %TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
231     |        <label for="comment_url">Url</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_url" id="comment_url" value="http://" /> |
232     | <label for="comment_link">Link label</label>| <input class="twikiInputField" %DISABLED% type="text" size="40" name="comment_link" id="comment_link" /> |
233     |    <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%" /> |
234     || <input %DISABLED% type="submit" value="%button|Add bookmark%" class="twikiButton" /> |
235     %TMPL:END%
236
237     %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"}%
238     %TMPL:END%
239
240 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[bookmark|Main/CommentPluginExamples#bookmark]]
241
242 #### <a name="return"></a> return
243
244 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%
245
246     %TMPL:DEF{returnpromptbox}%
247     <input type="hidden" name="redirectto" value="%BASEWEB%.%BASETOPIC%" />
248     %TMPL:P{promptbox}%
249     %TMPL:END%
250
251     %TMPL:DEF{PROMPT:return}%%TMPL:P{returnpromptbox}%%TMPL:END%
252
253     %TMPL:DEF{OUTPUT:return}%%POS:BEFORE%%TMPL:P{OUTPUT:threadmode}%%TMPL:END%
254
255 <img src="http://www.dementia.org/twiki//view/Main/WebHome/hand.gif" width="16" height="16" alt="hand" /> See rendered template [[return|Main/CommentPluginExamples#return]]
256
257 ## <a name="Include _UserComments"></a> Include UserComments
258
259 Including [[UserComments]]:
260
261 %TMPL:INCLUDE\{"UserComments"\}%