Difference: CommentPlugin (14 vs. 15)

Revision 152010-05-17 - TWikiContributor

Line: 1 to 1
Deleted:
<
<
 

Comment Plugin

Deleted:
<
<
 
Added:
>
>

The Comment Plugin lets users quickly post comments to a page without an edit/preview/save cycle.
 
Changed:
<
<
Comment Plugin lets users quickly post comments to a page without an edit/preview/save cycle.

Related topics: CommentPluginTemplates, CommentPluginExamples

WARNING: TWiki-4 only. If you want to use this plugin with an earlier version of TWiki, please use revision 31 of the zip.
>
>
Related topics: CommentPluginTemplates, CommentPluginExamples
 

Features

Line: 29 to 22
 
  • in other topics, or other positions within the current topic.

Syntax

Added:
>
>
  Write %COMMENT{attributes}% anywhere in a TWiki topic.
Changed:
<
<
  • A %COMMENT% without parameters shows a simple text box.
  • A %COMMENT{}% can handle the following parameters:
    Parameter Description Default
    type This is the name of the template to use for this comment. Comment templates are defined in a TWiki template - see customization. If this attribute is not defined, the type is whatever is defined by COMMENTPLUGIN_DEFAULT_TYPE, either in this topic or in your WebPreferences. "below"
    default Default text to put into the textarea of the prompt.  
    target Name of the topic to add the comment to the current topic
    location Regular expression specifying the comment location in the target topic. Read carefully the CommentPlugin documentation!  
    mode For compatibility with older versions only, synonymous with type  
    nonotify Set to "on" to disable change notification for target topics "off"
    noform Set to "on" to disable the automatic form that encloses your comment block - remember to insert <form> tags yourself! See CommentPluginExamples#noform for an example. "off"
    nopost Set to "on" to disable insertion of the posted text into the topic. "off"
    remove Set to "on" to remove the comment prompt after the first time it is clicked. "off"
    button Button label text "Add comment"
>
>
  • A %COMMENT% without parameters shows a simple text box.
  • A %COMMENT{}% can handle the following parameters:
    Parameter Description Default
    type This is the name of the template to use for this comment. Comment templates are defined in a TWiki template - see customization. If this attribute is not defined, the type is whatever is defined by COMMENTPLUGIN_DEFAULT_TYPE, either in this topic or in your WebPreferences. "below"
    default Default text to put into the textarea of the prompt.  
    target Name of the topic to add the comment to the current topic
    location Regular expression specifying the comment location in the target topic. Read carefully the CommentPlugin documentation!  
    mode For compatibility with older versions only, synonymous with type  
    nonotify Set to "on" to disable change notification for target topics "off"
    noform Set to "on" to disable the automatic form that encloses your comment block - remember to insert <form> tags yourself! See CommentPluginExamples#noform for an example. "off"
    nopost Set to "on" to disable insertion of the posted text into the topic. "off"
    remove Set to "on" to remove the comment prompt after the first time it is clicked. "off"
    button Button label text "Add comment"
 (See also additional attributes)

Positioning the comment

Line: 45 to 41
 will add comments in the current topic, directly below the %COMMENT tag.

Location relative to a TWiki anchor

Added:
>
>
 The target attribute may specify a web, and may also specify an anchor within the target topic; for example,
Changed:
<
<
 
<--/commentPlugin-->
>
>
 
<--/commentPlugin-->
 
Changed:
<
<
This uses a standard TWiki in-topic anchor as the insertion location. See TextFormattingRules for more about TWiki anchors.
>
>
This uses a standard TWiki in-topic anchor as the insertion location. See TextFormattingRules for more about TWiki anchors.
 

Location relative to an arbitrary text string

Added:
>
>
 Getting more sophisticated, you can also specify a regular expression for the target location using the location parameter. The target topic is searched for the regular expression, and the comment inserted relative to the string that the search matched. For example,
%COMMENT{type="above" location="Flights of Fancy"}%
Line: 56 to 54
 
%COMMENT{type="above" location="Flights of Fancy"}%
Changed:
<
<
will place comments above the first occurence of the string Flights of Fancy in the current topic.
>
>
will place comments above the first occurrence of the string Flights of Fancy in the current topic.
  Warning of course, if a user's comment contains the string "Flights of Fancy" they may and up changing the location for the next comment! Also, if you use a tag in the location, then you've just inserted another tag in the page that contains the %COMMENT! So be very careful how you specify the RE for location. Note that the RE is matched using perl "multiple line" mode, so ^ and $ match the start of a line and the end of a line respectively.
Also note that you cannot have the text location=" just before the location.
Line: 88 to 87
 

Customisation

Added:
>
>
 Customisation of the comment plugin requires
  • familiarity with HTML forms
Changed:
<
<
>
>
  To define a comment type, you have to provide two simple template definitions in the template file; one for the prompt box, and one for the generated output. If we have a template type "mytype", these are named PROMPT:mytype and OUTPUT:mytype respectively. See comments.tmpl in the templates directory for examples.

The plugin picks up these template definitions from a standard TWiki template file, templates/comments.tmpl. This allows different templates to be defined for different TWiki skins.

Defining custom templates

Deleted:
<
<
By default, templates/comments.tmpl includes the topic CommentPluginTemplate, which contains all the shipped standard templates and in turn includes TWiki.UserCommentsTemplate that can include non-standard customisations.
 
Changed:
<
<
This allows for several levels of customisation:
  1. To override all default templates, everywhere, change comments.tmpl to include a different topic (this customisation will be lost next time you upgrade, though).
  2. To add site-wide local template customisations, add them to UserCommentsTemplate (create if it does not exist yet). You can redefine the standard templates here if you want, and your definitions will override the standard definitions.
  3. To override templates on a web-by-web basis, add a topic UserCommentsTemplate to the web (this will replace TWiki.UserCommentsTemplate)
  4. To override templates for a specific skin, add them to TWiki.UserComments<Skin>Template (where <Skin> is the name of the skin with the first letter capitalised, e.g. Pattern)
>
>
By default, templates/comments.tmpl includes the topic CommentPluginTemplate, which contains all the shipped standard templates and in turn includes TWiki.UserCommentsTemplate that can include non-standard customizations.

This allows for several levels of customization:

  1. To override all default templates, everywhere, change comments.tmpl to include a different topic (this customization will be lost next time you upgrade, though).
  2. To add site-wide local template customizations, add them to UserCommentsTemplate (create if it does not exist yet). You can redefine the standard templates here if you want, and your definitions will override the standard definitions.
  3. To override templates on a web-by-web basis, add a topic UserCommentsTemplate to the web (this will replace TWiki.UserCommentsTemplate)
  4. To override templates for a specific skin, add them to TWiki.UserComments<Skin>Template (where <Skin> is the name of the skin with the first letter capitalized, e.g. Pattern)
  You can also define a comment template in a topic, by passing the topic location with templatetopic. For example:
Line: 180 to 185
 
Changed:
<
<

Customisation example with custom form template

>
>

Customisation example with custom form template

 Write a custom form in a topic.
  • In the form set the location of the prompt with %COMMENTPROMPT%; the prompt will be positioned here.
  • In %COMMENT use parameter noform="on"
Line: 214 to 222
 
%COMMENTPROMPT% Use with a custom form. If present, the comment prompt will be positioned here.

Changed:
<
<
All the usual TWikiVariables that can be used in a topic template can also be used in an OUTPUT template. See TWikiVariables for details.
>
>
All the usual TWikiVariables that can be used in a topic template can also be used in an OUTPUT template. See TWikiVariables for details.
 

Settings

Added:
>
>
 
Changed:
<
<
Two TWiki Preference variables are recognised by the CommentPlugin:
>
>
Two TWiki Preference variables are recognized by the CommentPlugin:
 
Preference Default Description
Changed:
<
<
%COMMENTPLUGIN_TEMPLATES% comments Name of template file in the 'templates' directory that contains the comment templates. The default 'comments.tmpl' automatically includes user templates from CommentPluginTemplate, which in turn includes UserCommentsTemplate.
>
>
%COMMENTPLUGIN_TEMPLATES% comments Name of template file in the 'templates' directory that contains the comment templates. The default 'comments.tmpl' automatically includes user templates from CommentPluginTemplate, which in turn includes UserCommentsTemplate.
 
%COMMENTPLUGIN_DEFAULT_TYPE% above Default template type
These can be set in TWikiPreferences, in WebPreferences or in individual topics.

#Installation

Plugin Installation Instructions

Changed:
<
<
  • This plugin is pre-installed in most TWiki releases. However if you need to upgrade the plugin for any reason:
>
>
  • This plugin is pre-installed in TWiki releases. However if you need to upgrade the plugin for any reason:
 
  • Download the archive file from the Plugin web (see below)
  • Unpack the archive in your twiki installation directory.
    • You may need to correct file permissions
Line: 248 to 259
 

Plugin Info

Changed:
<
<
Another great TWiki extension from the WikiRing - working together to improve your wiki experience!

Plugin Author: TWiki:Main.CrawfordCurrie http://www.c-dot.co.uk inspired by the work of TWiki:Main.DavidWeller and TWiki:Main.PeterMasiar
Plugin Version: 03 Aug 2008 17791 (02 Sep 2009)
Change History:  
>
>
Plugin Author: TWiki:Main/CrawfordCurrie http://www.c-dot.co.uk inspired by the work of TWiki:Main/DavidWeller and TWiki:Main/PeterMasiar
Copyright: © 2004, TWiki:Main/CrawfordCurrie;
© 2009 TWiki:Main/SopanShewale;
© 2004-2010 TWiki:TWiki/TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 18706 (2010-05-29)
Change History:
<-- versions below in reverse order -->
 
2010-05-16: TWikibug:Item6433 - doc improvements
2010-03-19 TWikibug:Item6404 Use $br in newline parameter for break tag instead of turning off encoding -- TWiki:Main/PeterThoeny
2010-02-27 TWikibug:Item6276 Cannot specify percentBRpercent for newline value -- TWiki:Main/SopanShewale
2009-01-21 TWikibug:Item6163 Fix for Comment Plugin losing data if target anchor is missing -- TWiki:Main/TimotheLitt and TWiki:Main/SopanShewale
 
03 Aug 2008 The TWiki 4.2.1 release version
11 Apr 2008 TWikibug:Item5518 corrected the template definition for bulletabove
5 Sep 2007 TWikibug:Item3689 corrected location handling TWikibug:Item4181 added VarCOMMENT TWikibug:Item4402 corrected access check
Line: 261 to 276
 
13311 Added option to define a comment template in any topic. Pass the topic location with templatetopic (either topic or web.topic). See an example in CommentPluginExamples:templatetopic.
12822 TWikibug:Item3598 minor doc fixes
12750 TWikibug:Item3510 added a note about the changed template spec in TWiki 4.1.0. Code remains unchanged
Changed:
<
<
11358 TWikibug:Item2802 moved SHORTDESCRIPTION to .pm. Coded up TWiki:main.PankajPant's suggestions as nopost and remove. Added default text for the %COMMENT as requested by TWiki:Main.AndyGlew
>
>
11358 TWikibug:Item2802 moved SHORTDESCRIPTION to .pm. Coded up TWiki:Main/PankajPant's suggestions as nopost and remove. Added default text for the %COMMENT as requested by TWiki:Main.AndyGlew
 
11118 TWikibug:Item2322 removed span tag around oneliner bullet output
8788 TWikibug:Item1465 Item1577: reverted 8433 to fix inclusion of correct user templates
8787 TWikibug:Item1573 renamed standard templates topic to avoid naming clash on Windows, where filenames are case-insensitive
Changed:
<
<
8433 TWikibug:Item1465 Fix 'TWiki.' to 'TWiki.'; also fixed include 'UserComments' to 'UserCommentsTemplate' (at least that is what the doc suggests)
>
>
8433 TWikibug:Item1465 Fix 'TWiki.' to '%TWIKIWEB%.'; also fixed include 'UserComments' to 'UserCommentsTemplate' (at least that is what the doc suggests)
 
7427 TWikibug:Item845 removed duplicate date in default comments; stick with server time
7251 TWikibug:Item810 fix for user template inclusion; reorganised templates to make customisation easier
5906 TWikibug:Item143 apache warning from comment plugin when CommentsTmpl.txt not found
Line: 280 to 295
 
4889 Chopped down from PeterMasiar version, removing several parameters, savecomment script, changing way templates are done. Major rewrite, atcherly.
4882 Update from PeterMasiar's 2.0 version, plus documentation and small code improvements.
4745 06 Mar 2002 initial commit
Changed:
<
<
Copyright: © 2004, TWiki:Main.CrawfordCurrie
© 2004-2007 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Home: TWiki:Plugins/CommentPlugin
Feedback: TWiki:Plugins/CommentPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

>
>
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/CommentPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/CommentPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/CommentPluginAppraisal
 
Changed:
<
<
META FILEATTACHMENT attr="h" comment="" name="wikiringlogo20x20.png" version="1"
>
>
Related Topics: CommentPluginTemplates, CommentPluginExamples, TWikiPreferences, TWikiPlugins
 
This site is powered by the TWiki collaboration platformCopyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.CommentPlugin.