Sandbox:CommentPluginExamples

From Tenetti
Revision as of 19:23, 27 November 2025 by oldwiki>ProjectContributor (Imported from Foswiki (version 1))

 !! 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"}%

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

%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%

  1. Sandbox:NoForm

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>

  1. Sandbox:TemplateTopic

templatetopic

Example of a form definition in a topic. The comment template is located in %SANDBOXWEB%.Sandbox:CommentPluginTemplateExample.

  1. 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" }%

---