It's better when it's simple

User Tools

Site Tools


catlist Plugin

Compatible with DokuWiki

  • 2015-08-10 "Detritus" unknown
  • 2014-09-29 "Hrun" yes
  • 2014-05-05 "Ponder Stibbons" yes
  • 2013-12-08 "Binky" yes

plugin List pages and namespaces recursively

Last updated on


This plugin lists pages and namespaces recursively in different forms (list, line…). You can excludes pages, namespaces and its content with regex. There is head options for personalize headline and if you have rights, you can create pages quickly with Add page… buttons in namespaces.


At right, example sidebar using Bootstrap, visible here.

Example using columns :


Legend : [needed], (optional)

<catlist (namespace:) -option1 -option2...>

If namespace is not provided, the namespace of current page is used

Options :

Display options
[Default] -displayList Display with <ul> and <li>. Render is like on the first screenshots above.
-displayLine Display pages and namespaces into a single line. The content of namespaces are warped with [ and ]. Warning there is some display bugs with it.
-noNSInBold Don't display namespaces and head in bold (with <strong>)
-columns:[0-∞] Split the list into a certain number of columns. Uses the modern CSS features column-count. [Default 0]
Force links options
-forceLinks Force namespace links to display even if the start page doesn't exist
Exclude options
-exclupage(:“regex”) Exclude pages that match with regex if provided; otherwise exclude all pages
-excluns(:“regex”) Exclude namespaces that match with regex if provided; otherwise exclude all namespaces
-exclunsall(:“regex”) Exclude all content of subnamespaces that match with regex if provided; otherwise don't show content of subnamespaces
-exclunspages(:“regex”) Exclude pages of subnamespaces that match with regex if provided; otherwise exclude all pages of subnamespaces
-exclunsns(:“regex”) Exclude subnamespaces of subnamespaces that match with regex if provided; otherwise exclude all subnamespaces of subnamespaces
Note : don't add delimiters to regex, the delimiter is /
-excludeOnID Exclusion based on id (namespace:subnamespace:page)
-excludeOnName Exclusion based on name, without namespaces (page)
-excludeOnTitle Exclusion based on the first title of the page (The Page)
-maxDepth:depth Don't recurse deeper than depth
Head options
-noHead Don't display headline
-smallHead Display headline into a simple <span>, not into a title
-noLinkStartHead Don't display link to the start page of listed namespace
[Default -h1] -h[1-5] Display headline into a title of the specified level
-titleHead:“Title Replace startpage title of listed namespace by specified Title
Create page buttons options
-noAddPageButton Don't display Add page… button for listed namespace
-addPageButtonEach Display Add page… button for each subnamespace (if you have rights to creating pages)
Sort options (filesystem sorting by default)
-sortAscending Ascending Sort (alphabetically)
-sortDescending Descending Sort (alphabetically)


You want to exclude all page in listed namespace (mynamespace) except mypage1 and mypage2 but you don't want to exclude pages in subnamespaces. It's a little bit hard in regex… I will simplify things like this but in the meantime, here is the solution :

<catlist blocs: -excluPage:"mynamespace:[^:]*(?<!mypage1|mypage2)$">

You can stylize the columns of the -columns: option by a small CSS code :

		.catlist_columns {
			-webkit-column-rule: 1px solid #BBB;
			   -moz-column-rule: 1px solid #BBB;
			        column-rule: 1px solid #BBB;


Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Alternatively, install from these links


Change Log

  • 2012-07-31
    • Initial release
  • 2012-09-02
    • Resolved bug with multi-leveled namespace in generated links
  • 2012-09-15
    • Added support for onfiguration option 'hidepages'
  • 2012-11-27
    • Added support for configuration options 'userewrite', 'useslash' and 'sepchar' in the “Add page…” button
  • 2012-11-30
    • Resolved a bug with empty 'hidepages' configuration option
  • 2013-01-28
    • -noLinkStartHead now works
    • When URL rewriting is not enabled, the add button don't redirect to the base URL, but use a relative one
  • 2013-06-02 : Qing Xianhao qingxianhao [at] gmail [dot] com
    • Fix a Add new page prefix problem
    • Add Simplified chinese translation
    • Add Enter key open edit page.
    • Copy on GuiHub
  • 2013-09-30 :
    • Don't list files that don't end with .txt
    • Added -maxDepth option
  • 2014-10-04 :
    • Sort options
    • Added russian (from rmuratov) and japanese translation
  • 2014-11-29 :
    • Typo bug affecting the sort function (thanks to aweall)
  • 2015-07-03 :
    • Columns displaying
  • 2015-07-08 :
    • Corrected fatal PHP syntax error

Known Bugs and Issues

  • Display bugs with -displayLine

ToDo/Wish List

  • Clean ID when creating page (in JS) (is there a function for cleaning IDs in dokuwiki's scripts ?). Curently, I only replace spaces by _ and check if pagename is not empty…


  • English
  • French
  • Chinese (Simplified)
  • Russian
  • Japanese


Please send me an e-mail at xcodexif [at] xif [dot] fr

I Found a bug. ;) If you have a multi-leveled namespace, the delimiter in the generated link switchs from “:” to “_”.

I solved it by changing the following line in method “_recurse()” from:
$this→_recurse($renderer, $data, $dir.'/'.$item, $dir.':'.$item, $exclunspages, $exclunsns);
$this→_recurse($renderer, $data, $dir.'/'.$item, $ns.':'.$item, $exclunspages, $exclunsns);


  • 29.11.2012 byte : This plugin doesnt work for me. I have set up an Instalation with the actual Versions(wiki,plugin,…). <catlist> show the first Heading from the actual Page with link to the actual Page and a “Add Page” Button. Thats all.
Bug resolved (2012-11-30)

How? I have the same problem.

Broken with useslash and userewrite options.

Change line in script.js from:

newPageID = baseUrl + script + str_replace(':',​ '/',​ newPageID); 


newPageID = str_replace(':',​ '/',​ newPageID);

TODO: add slash support depend user configuration. Reported by


I updated Catlist and the entire wiki went blank after leaving the plugin-update zone. After deletion of the plugin via server the wiki went online again. FYI: I also updated ODT export plugin in the same session and deleted this one first, but this was without result. This is the format I am using for catlist:

<catlist -excluPage:“start” -noHead> 

6-7-2015 MartinNL

Fix for PHP 5.3

Catlist would not work on my host with PHP 5.3 because 5.3 does not define the constants SCANDIR_SORT_NONE SCANDIR_SORT_ASCENDING and SCANDIR_SORT_DESCENDING. To make Catlist work with 5.3, I added the following near the beginning of syntax.php

//fix SCANDIR_SORT... CONSTANTS for PHP older than 5.4
defined('SCANDIR_SORT_NONE') or define('SCANDIR_SORT_NONE', 0);

Since 5.3 does not support SCANDIR_SORT_NONE, you can only have ascending or descending, you cannot have file system order. I always use ascending, so I made that the default, by defining SCANDIR_SORT_NONE the same as SCANDIR_SORT_ASCENDING.

2015-7-23 MJD

Please send me an e-mail at xcodexif [at] xif [dot] fr

plugin/catlist.txt · Last modified: 2015-07-24 08:15 by