How to create namespaces in DokuWiki

What is a Namespace? A Namespace is a folder location where your page resides, much like how you can organize files on your computer using folders and subfolders, wiki pages are organized into Namespaces. For information on creating pages, please click here. Namespaces are crucial for organizing your pages within your wiki. In other words, DokuWiki can store pages in sub locations or folders to organize your pages into sub categories. This is seen in the sitemap of the site (Image is below to the right).

Sitemap preview DokuWiki

For example, if you want to separate the pages to topics, you can place the pages under those Namespace names like the following.

  • Root (This is the root folder where all pages go)
    • HTML (Namespace is HTML)
      • HTML Basics (Subpage in HTML Namespace)
      • HTML 5 (Subpage in HTML Namespace)
      • HTML Reference (Subpage in HTML Namespace)
    • wiki (Default Namespace name)
      • dokuwiki (Subpage in wiki Namespace)
      • syntax (Subpage in wiki Namespace)
    • Page in root (This page reside in the Root Namespace)
    • Another page in root (This page reside in the Root Namespace)
    • start (This page reside in the Root Namespace)

You can see the Namespace and page structure where Namespaces are blue and pages are green. The root directory name is not listed in the website sitemap itself. Click the Sitemap link at the top right of the page to see the sitemap similar to the image to the right.

The Sitemap shows the Namespaces and their pages within them. The image to the right shows a basic DokuWiki sitemap with the name spaces in blue and the pages in green.

View of the Link Wizard namespaces DokuWiki

Namespaces can also be seen when creating links in the DokuWiki editor.

The Link wizard will show like the snapshot to the right. The Namespaces show as gold folder icons and the pages as blue note paper icons. For information on the Link wizard, see the article Inserting internal links in DokuWiki.

How to create a Namespace in DokuWiki

The next 2 sections will explain how to create Namespaces. Namespaces can be placed in the root directory or within other namespaces (like folders and subfolders on a computer). The following sections will explain these in detail.

Creating a Namespace in the Root directory

  1. Log into DokuWiki.
  2. Type the Namespace first and then the page name separating them with a : in the search box. The text you enter in the search should look like the following.
    nameofspace:Your new page name

    Note!!: Supplement nameofspace: with your new Namespace name. Namespaces have the : after them to designate it as a Namespace.

    Namespace in Root folder DokuWiki

    Type the name of the page you are creating after the : of the Namespace name. (In this case we entered “html:html 5 reference“.) Namespaces need to have a page created with it. You can’t just create a namespace. It should look like the snapshot to the right.

    Click the search magnifying glass icon.


  3. Edit page to create namesepace DokuWiki

    You will get a page not found. Click the pencil on the right that says “Create this page”.

    Insert text and save the changes.


  4. Preview of site map with the new namespace DokuWiki

    Click the Sitemap link at the top right. The new Namespace name (In this case “html“) will show in the menu like the image to the right with the page in it.

Create a Namespace within another Namespace

  1. Log into DokuWiki.
  2. Namespace within a namespace DokuWiki

    Type in the search box the first Namespace name and then the second subNamespace separating them with a : colon. The page name goes after the :. It should look like the following text.

    nameofspace:subNamespace:Your new page name

    Note!!: Supplement nameofspace: and subNamespace: and the Your new page name with your names. (Namespaces have the : after them to designate it as a Namespace.)

    In this case we entered “html:html5:html 5 Videos“. It should look like the image to the right.

    Click the search magnifying glass icon.


  3. Create second page DokuWiki

    Click the pencil to the right that says “Create this page” to create the page.

    Add content and Save the page.


  4. View Sitemap with sub namespace DokuWiki

    Click the sitemap link at the top right. You will see the Namespace (In this case “html:html5“) within another Namespace as a subsection like the right snapshot.

Now that you created Namespaces, you may want to rename or delete a Namespace. The next article will explain how to delete and rename Namespaces.

2 thoughts on “How to create namespaces in DokuWiki

Was this article helpful? Join the conversation!