Threaded discussions with NavFrames

In this learning project, we build a flexible operational model of a w:threaded discussion system with wikitext and NavFrames (see also: w:WP:NAVFRAME). I invite everybody to join.

Summary

As I know it, in mediawiki, every edit can alter only one page. The first conceptual question the programmer asks himself is: how can we make the parent node/thread/comment aware of a new sub-node/sub-thread/reply?

We achieve this by putting various replies to a previous comment on separate sections on a page[1], each transcludes all[2] its replies, each transcluding all its replies.... Each has a customised[3] reply button, an "external link" to an editing page for the subnode. The editing page is in turn "w:preloaded" with the same wikitext, and so the cycle continues.

So the key is in the preload page. [4] The relevant wikitexts consist of two lines (the link and the transclusion):

*reply[{{fullurl:{{<includeonly>subst:</includeonly>NAMESPACE}}:{{<includeonly>subst:</includeonly>BASEPAGENAME}}/{{<includeonly>subst:</includeonly>REVISIONTIMESTAMP}}|action=edit&preload=project:Threaded_discussions_with_NavFrames_with_subst/preload&section=new}}]
{{{{{subst|}}}{{<includeonly>subst:</includeonly>NAMESPACE}}:{{<includeonly>subst:</includeonly>BASEPAGENAME}}/{{<includeonly>subst:</includeonly>REVISIONTIMESTAMP}}|subst={{{subst|}}}}}

The "{{{subst|}}}" are for "optional substitution", to allow archiving and exporting, as explained in #Collapsing a thread.

Note that, as it turns out, e.g., the page Wikiversity:Threaded_discussions_with_NavFrames_with_subst/20070522105803 contains only the replies to what we think of as "comment/node number 20070522105803". "Node 20070522105803" itself is actually a section in its parent page. Thus we have provided a special:whatlinkshere link for each node to aid "naviagation towards the root thread".

[[Special:Whatlinkshere/{{<includeonly>subst:</includeonly>NAMESPACE}}:{{<includeonly>subst:</includeonly>PAGENAME}}|What links here]]

Grafting threads

Sometimes two threads/discussions started out indepentdently would converge. Our model is adept in handling such a situation.

We can graft two threads by simply adding a transclusion. In order to keep the thread "alive and in order", it is advisble not to simply cut and paste somebody else's comment/section/thread into another page(but it is all right to cut an paste your own comment/sectionthread). We have provided the preloads /graft and /grafteasy (which calls /grafteasy1). What they do is simply to add a comment which amounts to that "some other thread should be relevant to us here", and transcluding the "some other thread", and the structrure becomes as if that "some other thread" is (unknowingly) a reply to the local discussion. Schematicaly: (starting from left)


              -------*----*---
 /-----*----*/
*
 \--------*--------------------*
           \ "grafting"
            \
 /-----*----*------------*
*
 \--------*--

Collapsing a thread

Since a thread consists of many wikipages, it is not feasible to export all of them to another wiki. Here we use the optional substitution technique to collapse all the threads into one page. The relevant wikitext on the thread, which generally reads

{{ {{{subst|}}}namespace:basepagename/revisiontimestamp|subst={{{subst|}}} }}

is produced by

{{{{{subst|}}}{{<includeonly>subst:</includeonly>NAMESPACE}}:{{<includeonly>subst:</includeonly>BASEPAGENAME}}/{{<includeonly>subst:</includeonly>REVISIONTIMESTAMP}}|subst={{{subst|}}}}}

in the proload page.

Testing

Experiments has been carried out at betawikiversity:wikiversity:td,betawikiversity:wikiversity:tda,betawikiversity:wikiversity:tdb , betawikiversity:wikiversity:tdc , meta:meta:Threaded discussions with NavFrames, here WV:THREADNAV, wikiversity:Threaded discussions with NavFrames with subst with depth and w:zh-yue:user talk:hillgentleman/preload.

Reading a threaded discussion

By its nature, threaded discussion does not require archiving, and no thread is truely dead. One can read/monitor a threaded discussion by starting at any page/node. For example, in [[user:hillgentleman] may choose to transclude any one node amongst the subpages of his talk page.

We here have chosen to use w:NAVFRAME for displaying the threads. (I do not know any simpler trick that works - for example, transclusion and indentation do not work together. ) The relevant wikitexts are

<div class="NavFrame" style="text-align: left;">
<div class="NavHead" style="text-align: center;"> [[{{<includeonly>subst:</includeonly>NAMESPACE}}:{{<includeonly>subst:</includeonly>BASEPAGENAME}}/{{<includeonly>subst:</includeonly>REVISIONTIMESTAMP}}|{{<includeonly>subst:</includeonly>REVISIONTIMESTAMP}}]]</div>
<div  class="NavContent">

Here the m:magic word REVISIONTIMESTAMP, substituted, produces a time stamp which look like this: 20070522193137, which gives a unique index for each thread.

However, we may forgo the transclusion and just keep a link. Then each page displays only one node. And we would need a "what links here" link, once again, for navigation towards the root thread.

More discussions

See

Further developments

{{#tree|
*1.
**1.1
**1.11
**1.2
*2.
...
}}

Notes

  1. in fact, a subpage like this: full page name/revision time stamp
  2. Or, in the model "with depth", only up to a set depth
  3. indexed by the magic word REVISIONTIMESTAMP
  4. We have here:
    • wikiversity:Threaded discussions with NavFrames with subst/preload (the most developed)
    • wikiversity:Threaded discussions with NavFrames with subst with depth/preload
    • wikiversity:Threaded discussions with NavFrames with subst/preloadeasy which calls
      • wikiversity:Threaded discussions with NavFrames with subst/preloadeasy1
    • wikiversity:Threaded discussions with NavFrames with subst/graft (for #Grafting threads)
    • wikiversity:Threaded discussions with NavFrames with subst/grafteasy which calls
      • wikiversity:Threaded discussions with NavFrames with subst/grafteasy1
This article is issued from Wikiversity - version of the Thursday, April 01, 2010. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.