This is an old revision of the document!
Table of Contents
talkpage Plugin
Compatible with DokuWiki
Adora Belle
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to discussion
This plugin generates a link to a Talk Page (like used in Wikipedia or the Vector Template). It is intended to be used in a sidebar of templates not having native talk page support.
Installation
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
Change Log
- Merge pull request #33 from dokuwiki-translate/lang_update_784_170473… (2024-01-08 18:07)
- translation update (2024-01-08 17:45)
- Merge pull request #32 from dokuwiki-translate/lang_update_751_170180… (2023-12-05 21:04)
- translation update (2023-12-05 19:25)
- Merge pull request #31 from dokuwiki-translate/lang_update_651_168538… (2023-05-31 08:15)
- translation update (2023-05-29 20:35)
- Merge pull request #30 from dokuwiki-translate/lang_update_556_167459… (2023-01-25 09:15)
- translation update (2023-01-24 22:40)
Syntax
Simply add the macro ~~TALKPAGE~~
anywhere in your sidebar page.
Configuration and Settings
The namespace where talk pages are stored can be set in the config manager. It defaults to talk
.
Discussion
I would be super handy if this plugin could generate the discussion link in the floating page tools with the TEMPLATE_PAGETOOLS_DISPLAY event. I know it should be fairly easy but I don't know how to do it unfortunately. — Laynee 2015-07-27 02:42
Several Meta Pages
I added some lines to have multiple meta-pages related to one article page. Here it is an additional data page which could provide rawdata to use for example with the include plugin. Maybe some more people are interested?
<?php /** * DokuWiki Plugin talkpage (Syntax Component) * * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html * @author Andreas Gohr <andi@splitbrain.org> */ // must be run within Dokuwiki if (!defined('DOKU_INC')) die(); if (!defined('DOKU_LF')) define('DOKU_LF', "\n"); if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t"); if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once DOKU_PLUGIN.'syntax.php'; class syntax_plugin_talkpage extends DokuWiki_Syntax_Plugin { public function getType() { return 'substition'; } public function getPType() { return 'normal'; } public function getSort() { return 444; } public function connectTo($mode) { $this->Lexer->addSpecialPattern('~~TALKPAGE~~',$mode,'plugin_talkpage'); } public function handle($match, $state, $pos, &$handler){ $data = array(); return $data; } public function render($mode, &$renderer, $data) { global $INFO; if($mode != 'xhtml') return false; $renderer->info['cache'] = false; $talkns = cleanID($this->getConf('talkns')); $datans = cleanID($this->getConf('datans')); if(substr($INFO['id'],0,strlen($talkns)+1) === "$talkns:"){ // we're on the talk page $goto1 = substr($INFO['id'],strlen($talkns)+1); $goto2 = $datans .':'.substr($INFO['id'],strlen($talkns)+1); $text1 = 'back'; $text2 = 'data'; }elseif(substr($INFO['id'],0,strlen($talkns)+1) === "$datans:"){ // we're on the data page $goto1 = substr($INFO['id'],strlen($datans)+1); $goto2 = $talkns .':'.substr($INFO['id'],strlen($datans)+1); $text1 = 'back'; $text2 = 'talk'; }else{ // we are on article page // we want to the talk or data page $goto1 = $talkns .':'.$INFO['id']; $goto2 = $datans .':'.$INFO['id']; $text1 = 'talk'; $text2 = 'data'; //if(page_exists($talkpage)){ // $text = 'talk'; //}else{ // $text = 'add'; //} } $renderer->doc .= '<a href="'.wl($goto1).'" class="talkpage talkpage-'.$text1.'">'.$this->getLang($text1).'</a><br> <a href="'.wl($goto2).'" class="talkpage talkpage-'.$text2.'">'.$this->getLang($text2).'</a>'; return true; } } // vim:ts=4:sw=4:et: