Dokuwiki Tags

http://www.wikidesign.ch/en/plugin/tag/start

You can categorize pages in Dokuwiki using tags. A “tag” is just a word that you assign to a page, to describe what the page is about. Pages can have multiple tags.

Tags in Dokuwiki are a bit tricky (hence the reason for this page).

Installation

I did not use Dokuwiki's admin screen, because I kept getting errors.

  • Log in to the dokuwiki server.
  • Make sure to back up your entire dokuwiki directory
cp -r /your/dokuwikidir backupdir
  • CD to the lib/plugins subdirectory of your dokuwiki (Replace <DIR> below with the directory of your dokuwiki.
cd <DIR>/lib/plugins

You can copy/paste these commands into a terminal.

  wget http://www.qwik.ch/media/tag.tgz
  wget http://www.qwik.ch/media/feed.tgz
  wget http://www.qwik.ch/media/pagelist.tgz
  # Unzip the tgz files into the current directory (lib/plugins)
  tar -xzvf tag.tgz
  tar -xzvf feed.tgz
  tar -xzvf pagelist.tgz

You should now be able to use tagging. I don't remember any other steps :-\

Usage

I finally figured out how to do tags correctly by using the examples I found here: http://wiki.jalakai.co.uk/dokuwiki/doku.php/tag/plugin

  1. Figure out what you want to tag your dokuwiki page as. For example, I tagged this page with “Dokuwiki” and “tagging” (See the bottom right hand side of this page).
  2. Edit your page in Dokuwiki.
  3. Put a {{tag>}} thingy anywhere in the page.
  4. Put the the tag words from step #1 above after the > character, separated by a space between the tags. Example: {{tag>dokuwiki tagging}}
  5. Preview your page in Dokuwiki. You should see the tag(s) at the bottom of the page, in the right side. The tag words should have a tag icon next to them.
  6. Be sure to double-check how you have the {{tag>}} set up. Try putting a blank line before and after the tags. Dokuwiki is pretty picky about this, so make sure it's exactly as shown in the example above.

Displaying Pages with a Tag

Obviously, you will want to find all the pages that have a certain tag. To do this, you use the topic thingy:

{{topic>}}

For example, this code {{topic>poker}} will show all the pages having “poker” as a tag:

PageDescriptionTags
Bob's Poker Page I suck at poker bob, poker ,
Jim Jim's Page jim tag test jim, poker, personal , ,

Pages having Tag1 OR Tag2

To show pages tagged with poker OR bob, just put both tags in the topic>. Example: {{topic>bob poker}}

PageDescriptionTags
Bob Bob's Page bob, boo boo ,
Bob's Poker Page I suck at poker bob, poker ,
Jim Jim's Page jim tag test jim, poker, personal , ,

Pages having Tag1 AND Tag2

To show ONLY pages that have “bob” and “poker”, put a plus sign in front of “poker”.

Example: {{topic>bob +poker}}

PageDescriptionTags
Bob's Poker Page I suck at poker bob, poker ,

Tags With Spaces

You can tag a page with two words. Just make sure to enclose the tag in quotes.

Example: {{tag>"linux applications"}}

When listing pages tagged with “linux applications”, make sure you quote it there also.

Example: {{topic>"boo boo"}}

PageDescriptionTags
Bob Bob's Page bob, boo boo ,

Notice how {{topic>boo boo}} doesn't show any pages. (no quotes around boo boo).

Notes

Page Title

When listing pages that have a particular tag, Dokuwiki displays the first header of pages when listing the list, not the page name. For example, if you have a page named FOO, that has the header OVERVIEW, then “OVERVIEW” will show up in the list, not “FOO”.

Tags Appear as Backlinks

The taggging functionality takes a little time to “set in”. When I installed and started using tagging, I experienced the following oddities:

  • Problem The tags that you give a page are shown as “backlink” links.
    • Symptoms: You tag a page with “cooking” and “grilling”. At first, the “Cooking” and “Grilling” tags show up on the page as links on the left hand side of the page as “backlinks”.
    • Solution Wait a few days. This might have something to do with caching. You might be able to fix this immediately by deleting the “cache” directory, but I haven't tried it. I've just let it go, and after a day or two the tags appear on the right side of the screen with the cute little tags.
  • Problem: When you click on tags, they act as “backlinks”.
    • Diagnosis Clicking on a pages “tags” (shown with the cute tag icon) will take you to the “backlinks” for that tag.
    • Example In the cooking example above, f you click the “cooking” tag on pages that you've tagged as “cooking”, Dokuwiki takes you to a page which tries to list the pages that reference a non-existent “Cooking” page. Or, if you have a page called “cooking”, Dokuwiki lists the backlinks for your “cooking” page, which we don't want. We want to see the “cooking” page when we click on some page's “cooking” tag with the cute tag icon.
    • Solution Again, wait a few days and see if the problem clears up.
  • Dokuwiki's motto is to be simple, so tagging is done through these plugins. I always wince at the thought of installing multiple plugins. However, I understand that Dokuwiki doesn't want to be the Microsoft Word of wikis, so they keep this functionality separate.

Showing Links Versus Page

You might have a page that is titled git, but you might want to link to all the pages that are tagged with git.

To do this, use a link like this:

http://notesmine.com/git?do=showtag&tag=git

Dokuwiki Tags plugin does this automagically if you have a page tagged foo, but no page that's actually named foo.

See Also

You can get fancy with tags and tag lists. For example, Dokuwiki can show different things when listing pages with a certain tag.

See this website for more info: http://wiki.splitbrain.org/plugin:tag

Cloud

 
dokuwiki_tags.txt · Last modified: 2008/10/05 22_49 by tookelso
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki