Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

DiscussionTab

Summary: Provide a skin with a "discussion" tab and "article" tab, etc.
Version:
Prerequisites: Last tested on PmWiki version: pmwiki-2.0.11
Status:
Maintainer: NeilHerber, MarcSeibert

Note

This one works for me but it's not well coded I think. I am not a programmer and I haven't the time to improve my small php knowledge to get it work better. Maybe someone find it useful. If there is some help to improve this publish it or send me an email. MarcSeibert

Goal

Provide a tabbed skin with the possibility to have an "discussion"-tab and an "article"-tab as a kind of backlink to the Main Article. (It's similar to the tabs in MediaWiki but there are a few other possibilities to use this:

  • a Translation-Tab ( Cookbook/MultiLanguage works nice but for some projects its to complicated for the users)
  • a sub-page for attachments
  • a sub-page as gallery

and maybe some more ...

Solution

I modified Cookbook/CommentPageLink to work in a skin.tmpl . The original script only works as markup - but some skins would need an action . Also I changed the separator for the creation of the new discussionpage from "-" to the string "-Discuss-".

Include disctab.phpΔ to your local config.php Then edit the skin.tmpl to get some tabs. In monobook.tmpl you have to paste something like this:

  <!--function:DefineAction browse  Artikel | $ScriptUrl/$BaseName-->
 <!--function:DefineAction discuss $[Diskussion]-->  
  • Does this work for another skin? e.g. I use the Triad skin. --Guest

Todo

  • ...Problem with highlighting of the tabs ... What about a 'talk' action for the discussion tab, thus ending the double browse?PB(26Jul05)

action=discuss is implemented now - but the recipe cant highlight the discussiontab yet - didn't find the fault. Can someone help ??

  • Maybe it is possible to highlight the Tab only if there is an active discussion for the page ??
  • Two observations after using the recipe:-
    • I may be missing something obvious, but it would be handy to have the Back Link referred to in the opening text above, as the only way to get back to page being discussed is to manually type its name or url.
    • Colour coding the Discussion Tab text would be a simple way to show the existence of an actual discussion for the original page. The Discussion Tab text could be Red when there is no existing Discussion page, and Blue when there is an existing Discussion Des January 20, 2007, at 07:14 AM

Comments

You can include an inputform like CommentBox in the Comment.GroupHeader or Comment.GroupFooter. If you want to have a special describtion for non-existing discussionpages ( like: "There is no discussion for this articel") paste the following line to the end of your config.php

 $DefaultPageTextFmt = '(:include $Site.DefaultPageTemplate:)';

Then you can customize the look of your $DefaultPageTextFmt per group:

 (:if group Comments:)
 There is no discussion for this article \\
 You can start one here ... \\
(:commentboxchrono:)
(:if:)
(:if ! group Comments:)
 {$Name} doesn't exist. \\
 You can describe it [[{$Name}?action=edit| here]] 

Discussion

I had done some work on it and had satisfatory results.
Please visit "http://insteps.net/notebook2" to download the skin.
In "skin.php" you would find the code. There is a corresponding entry for link in "skin.tmpl" file.
There is small glitch i.e when you change the '$DefaultDiscussName" to any word of not 7 characters.
Please free to implement the word length part.
Otherwise it seems ok with simple functionality.
Just make similar entry of the code in your choice of skin.
Hope its useful.

Note: Pm also has some plans to implement a discussion/talk like feature. May its worth waiting.
~V.Krishn

I have modified disctab for my own needs, disctab_2.phpΔ :

  • adding $DiscussionAllowedGroup variable to control which group/page (in fact it's only a page prefix regexp checking) can have discussion. e.g. $DiscussionAllowedGroup = array('Main','PmWiki','Cookbook.DiscussionTab');
  • adding $DiscussionExceptGroup variable to control which group/page to exclude from discussion. e.g. $DiscussionExceptGroup = array('Site');
  • adding $DiscussionString to make the '-Discuss-' string configurable.
  • adding $DiscussionGroup to make the 'Comments' belonging group configurable.
  • adding (:if hasDiscuss:) to indicates at the commment page that: 1. The comment page's mother exists, 2. The comment page's mother is allowed to have discussion

--Jacky 31 Mar 2006

The installation of disctab is very unclear. For example, where do the two lines of code under 'Solution' go in monobook.tmpl?? Can someone please give clear step-by-step description?? Thanks! --Sameer 25 Jul 2007

See Also

Contributors

Edit - History - Print - Recent Changes - Search
Page last modified on February 08, 2008, at 01:29 PM