Skip to topic | Skip to bottom
Home
 
TWiki
TWiki.ThreadedDiscussionPluginr1.3 - 13 Apr 2005 - 19:57 - TWikiGuesttopic end

Start of topic | Skip to actions

ThreadedDiscussionPlugin

Generates a threaded discussion. Each discussion point can be edited individually, and discussion points can be commented on individually.

Syntax Rules

DISCUSSION Variable

  • Place the variable %DISCUSSION{...}% before any bullet list.
  • Supported parameters:
    "(list|thread)" Rendering style for discussion, see STYLE preference:
    =list= formats the discussion as a bullet list; the level of discussion is indicated by the indentation and the associated bullet symbol
    "thread" formats the discussion with colored thread lines to the left indicating the level.
    focus="text" Focus list on a bullet containing the specified text. If no depth (see below) is specified, focus limits the depth to the focus item plus two levels.
    depth="number" Hide bullets with an indent greater then depth. The depth is relative to the highlighted bullet in case focus is specified
    interactive="(on|off)" If on, the discussion is followed by a control allowing selection of depth and focus interactively.
  • To start a discussion, omit the bullet list. Any text that immediatly follows the %DISCUSSION{...}% variable on the same line is shown, but removed when the first discussion point is entered. This may serve as an introductory text inviting initiation of the discussion.

Bullets

  • Use regular * bullets
  • Start with level one
    • Increase indentation only one level at a time
      • Like this
  • Decreasing indentation many levels at a time is fine
  • You can specify an icon for a bullet:
    • Attach the icon to a topic, e.g. myicon.gif, or
    • Use one of the existing icons from TWikiDocGraphics
    • Refer to an attached icon at the beginning of the bullet with:
      • icon:myicon Followed by normal bullet text

Usage

  • You can turn any bullet list into a threaded discussion by prefixing the list with the %DISCUSSION{...}% variable.
  • You can edit each item of the bulleted list individually, and you can add further items by creating them individually.
    • Click on the EDITLABEL to edit the text at the selected item.
    • Click on the COMMENTLABEL to insert a comment to the current item. The comment is inserted as the last item at the next level of indentation.
    • Each item will become a list item. Consequentially, it may not contain newlines, lest the list will be interrupted. (However, each item can be arbitrarily long, and it will be rendered with the lines wrapped to page width.)
  • To start a new discussion, just insert the %DISCUSSION{...}% variable, immediately followed by some text. This text will be deleted when the first discussion item is added (click on either of the icons to edit a new item).

Examples

You type: You get: (simulated) You get: (if installed)
%DISCUSSION{"thread"}%
   * one
      * one.a
         * one.a.x
      * one.b
         * one.b.x
           continue
         * one.b.y
            * icon:person Tim
            * icon:person Mico
   * two
   * three

  one  EditComment
    one.a  EditComment
      one.a.x  EditComment
    one.b  EditComment
      one.b.x  EditComment
      continue  EditComment
      one.b.y  EditComment
          Tim  EditComment
          Mico  EditComment
  two  EditComment
  three  EditComment

one  Edit Comment
one.a  Edit Comment
one.a.x  Edit Comment
one.b  Edit Comment
one.b.x  Edit Comment
continue  Edit Comment
one.b.y  Edit Comment
  Tim  Edit Comment
  Mico  Edit Comment
two  Edit Comment
three  Edit Comment

You type: You get: (simulated) You get: (if installed)
%DISCUSSION{"thread" focus="Tim"}%
   * one
      * one.a
         * one.a.x
      * one.b
         * one.b.x
           continue
         * one.b.y
            * icon:person Tim
            * icon:person Mico
   * two
   * three

  one  EditComment
    one.b  EditComment
      one.b.y  EditComment
          Tim  EditComment

one  Edit Comment
one.b  Edit Comment
one.b.y  Edit Comment
  Tim  Edit Comment

You type: You get: (simulated) You get: (if installed)
%DISCUSSION{"thread" depth="2"}%
   * one
      * one.a
         * one.a.x
      * one.b
         * one.b.x
           continue
         * one.b.y
            * icon:person Tim
            * icon:person Mico
   * two
   * three

  one  EditComment
    one.a  EditComment
    one.b  EditComment
  two  EditComment
  three  EditComment

one  Edit Comment
one.a  Edit Comment
one.b  Edit Comment
two  Edit Comment
three  Edit Comment

You type: You get: (simulated) You get: (if installed)
%DISCUSSION{"list"}%Start a discussion

Start a discussion.  EditComment

Start a discussion  Edit Comment

ThreadedDiscussionPlugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %THREADEDDISCUSSIONPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Support a threaded discussion mode.

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

  • Determines how the discussion list will be rendered: list formats the discussion as an indented bullet list; thread formats the discussion with thread bars indicating the depth of the discussion.
    • Set STYLE = list

  • Formatting preferences for the thread style
    • Color, style, and thickness of line indicating thread as valid for the HTML style attribute
      • Set THREADCOLOR = solid thin #FFCCCC
      • #Set THREADCOLOR = dotted medium black
    • Additional icon separating thread lines
      • Set SPACEICON = 1, 16, 16, empty.gif
      • The first element is a 0|1 flag indicating whether to suppress or show thread lines at the top level; the next two arguments indicate width and height of icons, respectively; and the final argument gives the spacer icon between thread lines.

  • Labels for the edit and comment buttons. Can be textual or icons.
    • Set EDITLABEL = Edit
    • #Set EDITLABEL = Edit
    • Set COMMENTLABEL = Comment
    • #Set COMMENTLABEL = Comment

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip ThreadedDiscussionPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/ThreadedDiscussionPlugin.txt Plugin topic
    data/TWiki/ThreadedDiscussionPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/ThreadedDiscussionPlugin.pm Plugin Perl module
    bin/editthread edit script
  • Test if the installation was successful:
    • See if the above example works

Acknowledgment

This plugin was inspired by the TWiki:Plugins/RenderListPlugin and borrows code heavily from it.

Plugin Info

Plugin Author: TWiki:Main/ThomasWeigert
Plugin Version: 12 Apr 2005
Change History:  
15 Aug 2005: Fix problem with TWiki ML not rendering properly at end of section. Remove all but one apache warnings.
12 Apr 2005: Allow configurable edit and comment labels. Support bullet list style and thread style. More formatting options for thread lines.
21 Mar 2005: Integrate 21 Mar version of TWiki:Plugins/EditContrib
12 Mar 2005: Integrate TWiki:Plugins/EditContrib
08 Mar 2005: Initial version
CPAN Dependencies: none
Other Dependencies: TWiki:Plugins/EditContrib
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, ThreadedDiscussionPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ThreadedDiscussionPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ThreadedDiscussionPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ThreadedDiscussionPluginAppraisal

Related Topics: TWiki:Plugins/EditContrib, TWiki:Plugins/RenderListPlugin

-- TWiki:Main/ThomasWeigert - 15 Aug 2005


to top


You are here: TWiki > ThreadedDiscussionPlugin

to top

All content is Copyright © 1999-2017 by, and the property of, the contributing authors.
Questions, comments, or concerns? Contact GNHLUG
Legal Notice (includes Terms of Service)