Table of Contents

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.

A namespace can be created in the media manager after having selected a file on the local computer and adding a name: (of namespace wanted) just before the media file name and then clicking upload. This will create on the fly the namespace (folder) for the file media, visible after a refresh of the windows.

In DokuWiki, pages are created as in every other wiki. Simply create a link to a non existing page, follow this link, and click on Create this page. See also Adding pages.

Examples:
example
.example
.:example
refers to the page “example” in the current namespace.
:example refers to the page “example” in the root namespace.
..example
..:example
.:..:example
refers to the page “example” in the parent namespace
wiki:example refers to the page “example” in the namespace “wiki”. The namespace “wiki” is located beneath the root namespace.
ns1:ns2:example
:ns1:ns2:example
refers 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:example
.:ns1:ns2:example
refers 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:example
..:ns1:ns2:example
refers to the page “example” in the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beside the current namespace (i.e. both ns1 and the current namespace are beneath the same parent namespace, wherever according to the root namespace this parent may be located itself).
.ns1:ns2:
.:ns1:ns2:
refers to start page of the namespace ns2. The namespace ns2 is located beneath the namespace ns1; the namespace ns1 is located beneath the current namespace.

Please refer to Namespace Default Linking below how the start page is determined
~example
~:example
refers to the page “example”, using the current page as a namespace. Eg. if used on the page “foo:bar”, the link will refer to “foo:bar:example”. This is an effective way of creating sub-namespaces from existing pages.

:!: Gotcha: The syntax for relative and absolute internal links is non-unique and complex relative to directory and filename conventions.

Links are absolute if and only if they have a “:” prefix or have no prefix but do have intermediate (or suffix) “:”

Links relative to the current namespace may also begin with either “.” or “.:” (“..” or “..:” for parent namespace).

Referring Images

Regarding referring of namespaces, images and other media files are handled like wiki pages. That means, the following refers to an image that belongs to the current namespace:

{{image.jpg}}

Deleting namespaces

When all pages inside a namespace are removed (see delete a page) the namespace logically doesn’t exist anymore. DokuWiki usually deletes the now empty directory as well.

How to rename namespaces?

Manual way

In order to rename a namespace manually you will have to:

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 (i.e. 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 (i.e. recent changes):

DISCLAIMER: 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 having to do this manually.

Namespace Default Linking

It is possible to link to the default page of a namespace by ending the linkid with a colon: [[foo:bar:]]. Which page the link links to is dependent on the existence 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.

See startpage to learn about configuring the startpage name (defaults to start).