DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tagging

Tagging Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" unknown
  • 2016-06-26 "Elenor Of Tsort" yes
  • 2015-08-10 "Detritus" yes
  • 2014-09-29 "Hrun" yes

plugin Allows users to annotate pages with tags, search for tags and show all tags one user has used

Last updated on
2016-08-11
Provides
Syntax, Helper, Action
Repository
Source
Requires
sqlite

Similar to labeled

Tagged with annotations, cloud, tagcloud, tags

A CosmoCode Plugin

Installation

:!: This plugin requires the following additional plugin that must be installed separately:

Install the plugin using the Extension Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

After installation you need to add the component to display and edit a page's tags to your wiki. There are two ways.

Use in Sidebar

If your template supports a sidebar you can add the following syntax to it's contents to display the tagging component:

{{tagging::input}}

Please note that this will disable caching for the sidebar page.

Embed in Template

Alternatively you can add the tagging component directly into your template's main.php:

<?php
    //show tagging only if user has access to page. Works on wikis with disabled acl too.
    if (auth_quickaclcheck(getID()) >= AUTH_READ ) {
        //check if sqlite plugin exists, tagging plugin requires it.
        if (!plugin_isdisabled('sqlite')) {
            //Tagging
            $tagging = plugin_load('helper','tagging');
            if ($tagging) {
                $tagging->tpl_tags();
            }
        }
    }
?>

Users of the dokuwiki template could also put above code in a newly created file conf/sidebarfooter.html.

Using with Vector Template

Users of the vector template could also put following to dokuwiki/lib/tpl/vector/user/boxes.php (NOT dokuwiki/lib/tpl/vector/conf/boxes.php):

//show tagging only if user has access to page. Works on wikis with disabled acl too.
if (auth_quickaclcheck(getID()) >= AUTH_READ ) {
    //check if sqlite plugin exists, tagging plugin requires it. if it doesn't exist or is disabled, vector template won't render
    if (!plugin_isdisabled('sqlite')) {
        $tagging = plugin_load('helper','tagging');
        if ($tagging) {
    	    $_vector_boxes["tagging"]["headline"] = "Tagging";
	    $_vector_boxes["tagging"]["xhtml"] = $tagging->tpl_tags(false);  //set $print to false
        }
    }
}

The first param of tpl_tags($print = true) is set to false to prevent direct printing.

Usage

Tags can be assigned to pages by any logged in user with write permissions for the page in question. Anonymous users can never tag pages, even if they have write permissions.

Once the code mentioned in the install section is inserted into your template, each page will show the current page's tags and allows to edit them. Each tag is linked to a search for that tag.

Single-User vs. Multi-User mode

By default the tag plugin will record tags separately for each user. Each user can add their own tag to a page. Users may only edit the tags the added themselves.

If you want all your users to maintain a single tag corpus, you can switch the plugin to 'single user mode' in the config. All tags will be saved under the username auto and can be edited by all users.

Embedding Clouds in Pages

A syntax component allows to embed tag clouds in pages. A tag cloud displays a list of tags where more often used tags are shown larger than less frequently used ones.

To list all tags used by pages in the current namespace (and below) use the following syntax:

{{tagging::ns}}

To specify a certain namespace (other than the current one) add it like this:

{{tagging::ns>NAMESPACE}}

To list all tags used by pages of whole wiki, independend of current namespace use the following syntax:

{{tagging::ns>*}}

To list all tags that were used by the currently logged in user use the following syntax:

{{tagging::user}}

To show the tags of a specific user, add the user name like this:

{{tagging::user>USERNAME}}

Hidden Tags

You can configure a prefix for tags that should not be shown to users who can't add tags themselves. By default it's set to the @ character.

Hidden Tags are useful as shortcuts to be used with the jump function below.

Jump to Tagged Page

It's possible to directly jump to a page tagged with a certain keyword using the URL http://yourwiki/doku.php?do=tagjmp&tag=mytag where mytag is the tag you used on that page.

You can also specify multiple tags to try using the Array syntax in the URL: http://yourwiki/doku.php?do=tagjmp&tag[]=mytag1&tag[]=mytag2&tag[]=mytag3. Each tag is tried until an existing one is found.

This is useful to assign shortcuts for pages and jump to them from external programs for example. When the content moves you can change the tag and don't need to adjust your external tool.

Please note: if you tagged multiple pages with the same tag, this functionality will simply jump to one of those pages.

When the translation plugin is installed, the language of each tagged page is recorded. You can then specify the language in the jump action: http://yourwiki/doku.php?do=tagjmp&tag=mytag&lang=en. If you just recently upgraded the tagging plugin, note that languages will only be recorded for newly added tags.

Tag Management

An admin page allows you to find and rename tags.

Development

Change Log

Known Bugs and Issues

Please report bugs and issues at: https://github.com/cosmocode/tagging/issues

plugin/tagging.txt · Last modified: 2017-03-09 21:15 by andi