Plugin : nspages

---- plugin ----
description: Present a table of contents of the pages of a selected namespace
author     : Guillaume Turri
email      : guillaume.turri@gmail.com
type       : Syntax
lastupdate : 2018-12-03
compatible : 2017-02-19, 2016-06-26a, 2009-12-25, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, ponder stibbons, Hrun, Detritus, Greebo
depends    : 
conflicts  : 
similar    : catlist, dir, dirlisting, nstoc, pagequery, pagelist, pageindex, pglist
tags       : listing, menu, namespace, navigation

downloadurl: https://github.com/gturri/nspages/zipball/master
bugtracker : https://github.com/gturri/nspages/issues
sourcerepo : https://github.com/gturri/nspages/
donationurl: http://bit.ly/nspages_charityware

I'm looking for a co-maintainer!

If you're a user of this plugin, don't worry: I'm still taking care of it, I will make sure it keeps working with future versions of Dokuwiki. But I have much less time than before to dedicate to it, and as a consequence feature requests tend to pile up.

If you're interested in co-maintaining this plugin, just send me an email (adress available in the commit log).

This plugin nicely displays a table of content of the pages -and optionally the subnamespaces- of a given (sub)namespace.

Using this plugin is easy: just write


and see the result. (You may also use the button from the toolbar.)

The general syntax is

<nspages path_to_a_namespace -option1 -option2 ...>


  • path_to_a_namespace represents the path to the wanted namespace. It can be an absolute (ex: namespace1:subnamespace) or a relative path (ex: .:subnamespace). If no path is specified, the current namespace is selected.
  • -option may be one of the following (it is possible to specify several options):
Common options
displays the subnamespaces of the selected namespace (and provide links to their main page)
do not list the pages of the selected namespace (of course this option is useful only if you use -subns)
won't include the page nameOfPage. This option may be use several times in order to exclude several pages
won't include the subnamespace subNs. This option may also be used more than once
won't include the current page
will display the first h1 title found. If a page doesn't contain such a title, the name of the page is used instead
-textPages="some text"
some text will be displayed instead of the default text, to introduce the pages list
-textNS="some text"
some text will be displayed instead of the default text, to introduce the namespaces list
alias of -h1
display the list on a single column
display the list on a single column, as an ordered list
display the list on a single line (incompatible with -simpleList)
display the list on a single column, separated only by line breaks (incompatible with the previous flags)
display the first image of each page
Change the number of columns to use (default is 3)
Sort the pages according to their id, even if -title is used
Less common options
Sort the pages in reverse order
Sort the pages in natural order
Sort the pages by date of last modification
Sort the pages by date of creation
The pages will appear among the namespaces
recurse : display elements of the subnamespaces. You may use just -r to check every subnamespace, or e.g. -r=3 to have a depth limit to 3 levels
-exclude:[page1 subNs: page2]
an easier syntax to exclude several pages/subnamespaces
Enable the use of regex to select the documents that should be displayed. Eg: -pregPagesOn=“/doku/i” will display only pages which contains “doku” in their id.
Several options may be used, and each of them may be used several times.
Behaves like -pregPagesOn and -pregPagesOff & Co, but filters on the title (instead of the id).
Add anchors on each title-letters, to let link directly to them. Anchors will look like, e.g. for the letter A: nspages_myName_A
print an actual html title (not just a bold and underlined text)
print an actual html title <hn>
Use the format “id of the item - title of the item”
Display at most n pages or subnamespaces
Hide page header and “no pages” message if no pages present
Hide subnamespace header and “no subnamespace” message if no subns present
Specify the picture to display when -usePictures is used and a page doesn't contain any picture. Can be used to point at either a local file (

) or remote one (



Include pages that are normally excluded from search with the hidepages config parameter. Useful for creating table of contents for hidden namespaces.
Sort according to the locale specified (see the doc). Example of usage:


cette catégorie n'existe pas : path_to_a_namespace

Sous-catégories :

Pas de sous-catégories.

will work.

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

  • With version older than 2014-08-10, you should put ~~NOCACHE~~ in the pages where you use this plugin, to make sure that if you create or remove a page in the namespace, it will be taken into account. Now, nspages automatically deactivate the cache on the pages where it is used (you can deactivate this behaviour on the admin panel).
  • The CSS sheet should be taken into account in order for this plugin to work correctly; but because of the cache system it may not be the case the first time you use this plugin (even if ~~NOCACHE~~ is specified). The easier way to resolve this is to make sure your cache is invalidated by touching conf/local.php (eg. by resaving your configuration)
  • Currently, you may not use a '>' in the -textPages and -textNS options, since it is understood as the end of the tag
  • When you change the default markup inserted by the toolbar button (throught the admin dashboard), you may need to purge your caches to have this change taken into effect (see also the bug report):
    • Clean the cache of you DokuWiki
    • Force your browser to reload it's cache, typically by pressing Ctrl+F5, or Shift+F5

nspages is a personal open source project started in 2008. I have put hundreds of hours to maintain and enhance it.

It is provided as a charityware. It can be downloaded and installed at no charge. If you found it useful and would like to support its development, you may make a donation to a non-profit charitable organization.

The preference goes to the World Wildlife Fund (WWF) because the are both protecting biodiversity and fighting climate change effectively.

If it isn't possible, any association acting for the environment would do the trick.

Forwarding me (address available at the top of the page) the confirmation email you send or receive will ensure your kind gesture will motivate me to continue developing this software.

Making sure you have a positive impact would already be awesome:

  • Volunteer to an NGO near you. Give some of your time
  • Ride you bike instead of taking your car
  • Buy local organic food
  • Use a reusable bag and stop using plastic straws
  • Plant trees
  • Take only what you need, not what you can
  • wiki/nspages.txt
  • Dernière modification: 06/06/2019/ 00:40
  • par Geco-iT Administrator