Table of Contents

Namespaces

siehe auch eigenes Handbuch

In DokuWiki you can use so called “namespaces” to categorize your pages.

Creating Namespaces

You don't need to create namespaces separately; simply create pages with colons in the pagename. The token after the last colon will be the name of the page itself, while all other tokens are namespaces. All namespaces used in your pagename that don't exist already will be created by DokuWiki automatically.

Examples:
examplerefers to the page “example” in the current namespace.
:examplerefers to the page “example” in the root namespace.
wiki:examplerefers to the page “example” in the namespace “wiki”. The namespace “wiki” is located beneath the root namespace.
ns1:ns2:examplerefers to the page “example” in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the root namespace.
:ns1:ns2:examplesame as above.
.ns1:ns2:examplerefers to the page “example” in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the current namespace.
.ns1:ns2:refers to the page “start” in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the current namespace.

(The default page can be named something other than “start” by adjusting the start configuration setting.)

FIXME: also the [..namespace:] feature – to refer the parent namespace – should be documented, if it is intentional.

FIXME: the first example above is misleading, as the current namespace is always ':', please update document

Current namespace is the same namespace as for the refering page, so the example is OK.

Dei Startseite befindet sich im Root des Wikis, daher muss der Doppelpunkt am Anfang des Namens geschrieben werden, also:

Syntax: [[:start|Start]]\\

Deleting Namespaces

When all pages inside a namespace are removed the namespace logically doesnt exist anymore. DokuWiki usually deletes the now empty directory as well.

FIXME This seems not to work properly. My dokuwiki keeps namespaces although all pages are deleted.

How to rename namespaces?

You can use the PageMove plugin to move each of the pages from the old namespace to the new one. Please consult the documentation to see if this fits your needs.

The manual way is more difficult:

For example, on a Unix host, you could:

Note that the old_namespace and/or new_namespace words may need to be encoded if they are on a non-latin character set (ie Greek, Russian etc).

However, you will still have lots of junk left around. For example in data/changes.log, various files under cache (including the .idx files etc). If possible you could just start from a blank state as follows (again under Unix) but be warned that this will mean losing all your historical information (ie recent changes):

I understand this is convoluted (and maybe I missed/messed a couple of things you should also do). All in all this is a PITA. You may also use a couple of plugins that are available for (re)building the searchindex for the complete wiki, erasing entire cache and/or old wiki revisions thus avoiding to do this manually.

Namespace Default Linking

It is possible to link to a default file of a namespace ending the linkid with a colon: [[foo:bar:]]. To which page the link links is dependent on the existance of certain named files. For [[foo:bar:]] the following pages are checked:

foo:bar:$conf['start']
foo:bar:bar
foo:bar

The pages are checked in that order and whatever page is found first will be linked to. Autoplural linking is not done for those links

:!: This feature is only available in 2006-09-28 RC1 version and above.