Sandbox:CommentPluginExamples: Difference between revisions
m 1 revision imported |
m 1 revision imported |
||
| (12 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
* Top comment output 2 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * Top comment output 2 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
* Top comment output 1 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * Top comment output 1 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
<code> !! [[CommentPlugin]] examples </code> | <code> !! [[Sandbox:CommentPlugin]] examples </code> | ||
See %SYSTEMWEB%.[[CommentPlugin]] | See %SYSTEMWEB%.[[Sandbox:CommentPlugin]] | ||
%TOC% | %TOC% | ||
=<code> ![[CommentPlugin]] templates </code>= | =<code> ![[Sandbox:CommentPlugin]] templates </code>= | ||
==<code> Default </code>== | ==<code> Default </code>== | ||
| Line 14: | Line 14: | ||
Default comment output 1 | Default comment output 1 | ||
-- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
Default comment output 2 | Default comment output 2 | ||
-- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
%COMMENT{}% | %COMMENT{}% | ||
| Line 34: | Line 34: | ||
Above comment output 1 | Above comment output 1 | ||
-- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
Above comment output 2 | Above comment output 2 | ||
-- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
%COMMENT{type="above"}% | %COMMENT{type="above"}% | ||
| Line 44: | Line 44: | ||
%COMMENT{type="below"}% | %COMMENT{type="below"}% | ||
* Below comment output 2 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * Below comment output 2 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
* Below comment output 1 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * Below comment output 1 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
==<code> </code>bulletabove<code> </code>== | ==<code> </code>bulletabove<code> </code>== | ||
| Line 58: | Line 58: | ||
Threadmode comment output 1 | Threadmode comment output 1 | ||
-- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
Threadmode comment output 2 | Threadmode comment output 2 | ||
-- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
%COMMENT{type="threadmode"}% | %COMMENT{type="threadmode"}% | ||
| Line 69: | Line 69: | ||
%COMMENT{type="belowthreadmode"}% | %COMMENT{type="belowthreadmode"}% | ||
===<code> %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 - 12:09 </code>=== | ===<code> %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 - 12:09 </code>=== | ||
Belowthreadmode comment output 2 | Belowthreadmode comment output 2 | ||
===<code> %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 - 12:09 </code>=== | ===<code> %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 - 12:09 </code>=== | ||
Belowthreadmode comment output 1 | Belowthreadmode comment output 1 | ||
| Line 80: | Line 80: | ||
%COMMENT{type="tableprepend"}% | %COMMENT{type="tableprepend"}% | ||
| Tablepreprend comment output 2 | %USERSWEB%.[[ProjectContributor]] | 26 Nov 2006 - 11:03 | | | Tablepreprend comment output 2 | %USERSWEB%.[[Sandbox:ProjectContributor]] | 26 Nov 2006 - 11:03 | | ||
| Tablepreprend comment output 1 | %USERSWEB%.[[ProjectContributor]] | 26 Nov 2006 - 11:02 | | | Tablepreprend comment output 1 | %USERSWEB%.[[Sandbox:ProjectContributor]] | 26 Nov 2006 - 11:02 | | ||
==<code> </code>tableappend<code> </code>== | ==<code> </code>tableappend<code> </code>== | ||
| Tableappend comment output 1 | %USERSWEB%.[[ProjectContributor]] | 26 Nov 2006 - 10:38 | | | Tableappend comment output 1 | %USERSWEB%.[[Sandbox:ProjectContributor]] | 26 Nov 2006 - 10:38 | | ||
| Tableappend comment output 2 | %USERSWEB%.[[ProjectContributor]] | 26 Nov 2006 - 10:39 | | | Tableappend comment output 2 | %USERSWEB%.[[Sandbox:ProjectContributor]] | 26 Nov 2006 - 10:39 | | ||
%COMMENT{type="tableappend"}% | %COMMENT{type="tableappend"}% | ||
==<code> </code>after<code> </code>== | ==<code> </code>after<code> </code>== | ||
* After comment output 1 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * After comment output 1 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
* After comment output 2 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * After comment output 2 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
%COMMENT{type="after"}% | %COMMENT{type="after"}% | ||
==<code> </code>action<code> </code>== | ==<code> </code>action<code> </code>== | ||
(requires Foswiki:Extensions/[[ActionTrackerPlugin]]) | (requires Foswiki:Extensions/[[Sandbox:ActionTrackerPlugin]]) | ||
%ACTION{ due<code>"1-Dec-2007" creator</code>"%USERSWEB%.[[ProjectContributor]]" uid<code>"000001" state</code>"open" created<code>"26-Nov-2006" who</code>"%USERSWEB%.[[ProjectContributor]]" }% <<EOF | %ACTION{ due<code>"1-Dec-2007" creator</code>"%USERSWEB%.[[Sandbox:ProjectContributor]]" uid<code>"000001" state</code>"open" created<code>"26-Nov-2006" who</code>"%USERSWEB%.[[Sandbox:ProjectContributor]]" }% <<EOF | ||
Action comment output 1 | Action comment output 1 | ||
- Created by %USERSWEB%.[[ProjectContributor]], 26 Nov 2006 - 10:58 | - Created by %USERSWEB%.[[Sandbox:ProjectContributor]], 26 Nov 2006 - 10:58 | ||
EOF | EOF | ||
%ACTION{ due<code>"1-Jan-2008" creator</code>"%USERSWEB%.[[ProjectContributor]]" uid<code>"000003" state</code>"open" created<code>"26-Nov-2006" who</code>"%USERSWEB%.[[ProjectContributor]]" }% <<EOF | %ACTION{ due<code>"1-Jan-2008" creator</code>"%USERSWEB%.[[Sandbox:ProjectContributor]]" uid<code>"000003" state</code>"open" created<code>"26-Nov-2006" who</code>"%USERSWEB%.[[Sandbox:ProjectContributor]]" }% <<EOF | ||
Action comment output 2 | Action comment output 2 | ||
- Created by %USERSWEB%.[[ProjectContributor]], 26 Nov 2006 - 10:58 | - Created by %USERSWEB%.[[Sandbox:ProjectContributor]], 26 Nov 2006 - 10:58 | ||
EOF | EOF | ||
%COMMENT{type="action"}% | %COMMENT{type="action"}% | ||
| Line 111: | Line 111: | ||
==<code> </code>table<code> </code>== | ==<code> </code>table<code> </code>== | ||
| 1 Dec 2007 | %USERSWEB%.[[ProjectContributor]] | Athens | | | 1 Dec 2007 | %USERSWEB%.[[Sandbox:ProjectContributor]] | Athens | | ||
| 1 Jan 2008 | %USERSWEB%.[[ProjectContributor]] | Beijing | | | 1 Jan 2008 | %USERSWEB%.[[Sandbox:ProjectContributor]] | Beijing | | ||
%COMMENT{type="table"}% | %COMMENT{type="table"}% | ||
==<code> </code>toctalk<code> </code>== | ==<code> </code>toctalk<code> </code>== | ||
===<code> 26 Nov 2006 - 00:45 %USERSWEB%.[[ProjectContributor]]: Toctalk output summary 1 </code>=== | ===<code> 26 Nov 2006 - 00:45 %USERSWEB%.[[Sandbox:ProjectContributor]]: Toctalk output summary 1 </code>=== | ||
Toctalk output message 1 | Toctalk output message 1 | ||
===<code> 26 Nov 2006 - 11:09 %USERSWEB%.[[ProjectContributor]]: Toctalk output summary 2 </code>=== | ===<code> 26 Nov 2006 - 11:09 %USERSWEB%.[[Sandbox:ProjectContributor]]: Toctalk output summary 2 </code>=== | ||
Toctalk output message 2 | Toctalk output message 2 | ||
| Line 132: | Line 132: | ||
==<code> </code>return<code> </code>== | ==<code> </code>return<code> </code>== | ||
Post to a different topic and return to here. In this example comments are written to [[%COMMENT_TOPIC%]]. | Post to a different topic and return to here. In this example comments are written to [[Sandbox:%COMMENT_TOPIC%]]. | ||
<!-- | <!-- | ||
* Set COMMENT_TOPIC = %SANDBOXWEB%.[[CommentPluginExampleComments]] | * Set COMMENT_TOPIC = %SANDBOXWEB%.[[Sandbox:CommentPluginExampleComments]] | ||
--> | --> | ||
| Line 146: | Line 146: | ||
%COMMENT{type<code>"return" target</code>"%COMMENT_TOPIC%"}% %BR% | %COMMENT{type<code>"return" target</code>"%COMMENT_TOPIC%"}% %BR% | ||
#[[NoForm]] | #[[Sandbox:NoForm]] | ||
==<code> </code>noform<code> </code>== | ==<code> </code>noform<code> </code>== | ||
Example of a custom form to save a comment to a new or existing topic. If topic is created, the parent will not be set.. | Example of a custom form to save a comment to a new or existing topic. If topic is created, the parent will not be set.. | ||
<form method<code>"post" action</code>"%SCRIPTURL{rest}%/[[CommentPlugin]]/comment" enctype<code>"application/x-www-form-urlencoded" name</code>"noformcomment0" id="noformcomment0"> | <form method<code>"post" action</code>"%SCRIPTURL{rest}%/[[Sandbox:CommentPlugin]]/comment" enctype<code>"application/x-www-form-urlencoded" name</code>"noformcomment0" id="noformcomment0"> | ||
<input type<code>"hidden" name</code>"topicparent" value="[[CommentPluginExampleComments]]" /> | <input type<code>"hidden" name</code>"topicparent" value="[[Sandbox:CommentPluginExampleComments]]" /> | ||
<input type<code>"hidden" name</code>"topic" value="%BASEWEB%/%BASETOPIC%" /> | <input type<code>"hidden" name</code>"topic" value="%BASEWEB%/%BASETOPIC%" /> | ||
<input type<code>"hidden" name</code>"endPoint" value="%BASEWEB%/%BASETOPIC%#[[NoForm]]" /> | <input type<code>"hidden" name</code>"endPoint" value="%BASEWEB%/%BASETOPIC%#[[Sandbox:NoForm]]" /> | ||
<input type<code>"hidden" name</code>"comment_action" value="save" /> | <input type<code>"hidden" name</code>"comment_action" value="save" /> | ||
<div class="foswikiFormSteps"> | <div class="foswikiFormSteps"> | ||
<div class="foswikiFormStep"> | <div class="foswikiFormStep"> | ||
'''New topic name:''' %BR% | '''New topic name:''' %BR% | ||
<input class<code>"foswikiInputField" %DISABLED% type</code>"text" size<code>"40" name</code>"comment''target" id<code>"comment''target" value</code>"" /> <span class="foswikiGrayText">Enter a ![[WikiWord]] topic name</span> | <input class<code>"foswikiInputField" %DISABLED% type</code>"text" size<code>"40" name</code>"comment''target" id<code>"comment''target" value</code>"" /> <span class="foswikiGrayText">Enter a ![[Sandbox:WikiWord]] topic name</span> | ||
</div> | </div> | ||
<div class="foswikiFormStep foswikiLast"> | <div class="foswikiFormStep foswikiLast"> | ||
| Line 167: | Line 167: | ||
</form> | </form> | ||
#[[TemplateTopic]] | #[[Sandbox:TemplateTopic]] | ||
==<code> </code>templatetopic<code> </code>== | ==<code> </code>templatetopic<code> </code>== | ||
Example of a form definition in a topic. The comment template is located in %SANDBOXWEB%.[[CommentPluginTemplateExample]]. | Example of a form definition in a topic. The comment template is located in %SANDBOXWEB%.[[Sandbox:CommentPluginTemplateExample]]. | ||
#CommentDate1176024819 | #CommentDate1176024819 | ||
%USERSWEB%.[[ProjectContributor]] - 08 Apr 2007: | %USERSWEB%.[[Sandbox:ProjectContributor]] - 08 Apr 2007: | ||
templatetopic example comment output 1 | templatetopic example comment output 1 | ||
--- | --- | ||
%COMMENT{noform<code>"on" type</code>"example" templatetopic<code>"%SANDBOXWEB%.[[CommentPluginTemplateExample]]" target</code>"{{PAGENAME}}" button="Add comment" }% | %COMMENT{noform<code>"on" type</code>"example" templatetopic<code>"%SANDBOXWEB%.[[Sandbox:CommentPluginTemplateExample]]" target</code>"{{PAGENAME}}" button="Add comment" }% | ||
--- | --- | ||
* Bottom comment output 1 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * Bottom comment output 1 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
* Bottom comment output 2 -- %USERSWEB%.[[ProjectContributor]] - 26 Nov 2006 | * Bottom comment output 2 -- %USERSWEB%.[[Sandbox:ProjectContributor]] - 26 Nov 2006 | ||
Latest revision as of 12:29, 28 November 2025
- Top comment output 2 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
- Top comment output 1 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
!! Sandbox:CommentPlugin examples
See %SYSTEMWEB%.Sandbox:CommentPlugin
%TOC%
!Sandbox:CommentPlugin templates
Default
Default comment output 1
-- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
Default comment output 2
-- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
%COMMENT{}%
top
%COMMENT{type="top"}%
bottom
%COMMENT{type="bottom"}%
above
Above comment output 1
-- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
Above comment output 2
-- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006 %COMMENT{type="above"}%
below
%COMMENT{type="below"}%
- Below comment output 2 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
- Below comment output 1 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
bulletabove
Example with inputsize"20"=:
- Bullet above comment output 1
- Bullet above comment output 2
%COMMENT{type"bulletabove" inputsize"20"}%
threadmode
Threadmode comment output 1
-- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
Threadmode comment output 2
-- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006 %COMMENT{type="threadmode"}%
belowthreadmode
%COMMENT{type="belowthreadmode"}%
%USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006 - 12:09
Belowthreadmode comment output 2
%USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006 - 12:09
Belowthreadmode comment output 1
tableprepend
%COMMENT{type="tableprepend"}% | Tablepreprend comment output 2 | %USERSWEB%.Sandbox:ProjectContributor | 26 Nov 2006 - 11:03 | | Tablepreprend comment output 1 | %USERSWEB%.Sandbox:ProjectContributor | 26 Nov 2006 - 11:02 |
tableappend
| Tableappend comment output 1 | %USERSWEB%.Sandbox:ProjectContributor | 26 Nov 2006 - 10:38 | | Tableappend comment output 2 | %USERSWEB%.Sandbox:ProjectContributor | 26 Nov 2006 - 10:39 | %COMMENT{type="tableappend"}%
after
- After comment output 1 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
- After comment output 2 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
%COMMENT{type="after"}%
action
(requires Foswiki:Extensions/Sandbox:ActionTrackerPlugin)
%ACTION{ due"1-Dec-2007" creator"%USERSWEB%.Sandbox:ProjectContributor" uid"000001" state"open" created"26-Nov-2006" who"%USERSWEB%.Sandbox:ProjectContributor" }% <<EOF
Action comment output 1
- Created by %USERSWEB%.Sandbox:ProjectContributor, 26 Nov 2006 - 10:58
EOF
%ACTION{ due"1-Jan-2008" creator"%USERSWEB%.Sandbox:ProjectContributor" uid"000003" state"open" created"26-Nov-2006" who"%USERSWEB%.Sandbox:ProjectContributor" }% <<EOF
Action comment output 2
- Created by %USERSWEB%.Sandbox:ProjectContributor, 26 Nov 2006 - 10:58
EOF
%COMMENT{type="action"}%
table
| 1 Dec 2007 | %USERSWEB%.Sandbox:ProjectContributor | Athens | | 1 Jan 2008 | %USERSWEB%.Sandbox:ProjectContributor | Beijing | %COMMENT{type="table"}%
toctalk
26 Nov 2006 - 00:45 %USERSWEB%.Sandbox:ProjectContributor: Toctalk output summary 1
Toctalk output message 1
26 Nov 2006 - 11:09 %USERSWEB%.Sandbox:ProjectContributor: Toctalk output summary 2
Toctalk output message 2
%COMMENT{type="toctalk"}%
bookmark
- [output link label] %IF{"
" then"" else="- "}% - [[1]] %IF{" 'Bookmark output comment'
" then"" else="- "}%Bookmark output comment
%COMMENT{type="bookmark"}%
return
Post to a different topic and return to here. In this example comments are written to Sandbox:%COMMENT_TOPIC%.
Comments:
%INCLUDE{%COMMENT_TOPIC%}%
---
%COMMENT{type"return" target"%COMMENT_TOPIC%"}% %BR%
noform
Example of a custom form to save a comment to a new or existing topic. If topic is created, the parent will not be set..
<form method"post" action"%SCRIPTURL{rest}%/Sandbox:CommentPlugin/comment" enctype"application/x-www-form-urlencoded" name"noformcomment0" id="noformcomment0">
<input type"hidden" name"topicparent" value="Sandbox:CommentPluginExampleComments" />
<input type"hidden" name"topic" value="%BASEWEB%/%BASETOPIC%" />
<input type"hidden" name"endPoint" value="%BASEWEB%/%BASETOPIC%#Sandbox:NoForm" />
<input type"hidden" name"comment_action" value="save" />
New topic name: %BR%
<input class"foswikiInputField" %DISABLED% type"text" size"40" name"commenttarget" id"commenttarget" value"" /> Enter a !Sandbox:WikiWord topic name
Topic text: %BR%
%COMMENT{noform"on" button"Save"}%
</form>
templatetopic
Example of a form definition in a topic. The comment template is located in %SANDBOXWEB%.Sandbox:CommentPluginTemplateExample.
- CommentDate1176024819
%USERSWEB%.Sandbox:ProjectContributor - 08 Apr 2007:
templatetopic example comment output 1
---
%COMMENT{noform"on" type"example" templatetopic"%SANDBOXWEB%.Sandbox:CommentPluginTemplateExample" target"Sandbox:CommentPluginExamples" button="Add comment" }%
---
- Bottom comment output 1 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006
- Bottom comment output 2 -- %USERSWEB%.Sandbox:ProjectContributor - 26 Nov 2006