DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:nsrelation

NSRelation Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" no
  • 2020-07-29 "Hogfather" unknown

plugin Shows links to the same page but in related namespaces

Last updated on
2007-11-22
Provides
Syntax

Similar to translation

Tagged with menu, namespace, navigation

This plugin shows a list of pages, available or not, in related namespaces. It is fully based on localization but has nothing to do with languages.

It is useful when you have several people working on the same project. Their description of things will be different but related if they are about the same thing. So it's handy to have buttons that link to others descriptions.

Each people (or group of people) will be associated a namespace, under which a thing will be a page.

If it's still unclear, you can see a demo here.

Download

Change Log

2007-11-22

  • now uses pipe separators for configuration of namespaces and their display strings
  • better css code

Installation

  1. Download and install the plugin through the Extension Manager.
  2. Configure it through the Config Manager
  3. Add the following code in your template's main.php (or put it in a dokuwiki\lib\tpl\default\pageheader.html file for the default template)
<?php
$nsrelation = &plugin_load('syntax','nsrelation');
echo $nsrelation->_showNSRelations();
?>

Configuration

There are several config options, all accessible through the config manager.

You need to setup the namespaces you want your pages be linked to. Separate each one with a comma or space. There is no default namespace.

You can optionally choose to display prettier stings instead of the raw namespaces names. Separate each one with a comma. If this plugin doesn't find enough values, it will default to the raw namespaces.

You can define a namespace in which the display of the buttons should be done, and in which your related namespaces will reside. This is optional, leaving it empty will enable the plugin for the root namespace.

You might want to explain how the related namespaces work on your wiki to your users. To make this description easily accessible from the namespace selector, enter the pagename of your description in the configuration.

Manual configuration

If you don't use the Config Manager and prefer configuring your wiki editing the config file, the useful lines which have to be added to your local.php configuration file are:

$conf['plugin']['nsrelation']['nsrelations']        = 'desc_short desc_full desc_geek';      // available related namespaces
$conf['plugin']['nsrelation']['nsrelationsdisplay'] = 'short desc., full desc., geek desc.'; // strings to display in selector
$conf['plugin']['nsrelation']['nsrelationrootns']   = "descriptions";                        // namespace where to activate
$conf['plugin']['nsrelation']['about']              = "descriptions:start";                  // page describing the relation process to users

Usage

The plugin does its work automatically by being called from the template (see installation), but you can disable it for a certain page by adding the following code to the top of the page:

~~NO_NSREL~~

Credits

Thanks to Andi for the base code, I didn't have to work much.

plugin/nsrelation.txt · Last modified: 2023-12-14 17:28 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki