Namespaces

A namespace is similar to a directory or folder, while pagenames are similar to files.

In DokuWiki you can use so called “namespaces” to categorize your pages. For names of namespaces the same restrictions hold as for pagenames.

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.

(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.) Adding pages .

Examples:
example
.example
.:example
refers to the page “example” in the current namespace.
:examplerefers to the page “example” in the root namespace.
..example
..:example
.:..:example
refers to the page “example” in the parent namespace
wiki:examplerefers 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: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.)

Deleting Namespaces

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

wiki/namespaces.txt · Last modified: 2009/03/13 21:57 (external edit)
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0