From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear app error.png
Book Manager

Release status:Extension status unstable

ImplementationTemplate:Extension#type Parser extension, User interface
DescriptionTemplate:Extension#description Tools for books
Author(s)Template:Extension#username Raylton P. Sousa and Helder.wiki
Latest versionTemplate:Extension#version 0.1.x
MediaWikiTemplate:Extension#mediawiki 1.18+
LicenseTemplate:Extension#license GPL v3 or Any OSI approved license
Hooks usedTemplate:Extension#hook

Translate the BookManager extension if it is available at translatewiki.net

Check usage and version matrix.


Open tasks · Report a bug

This extension adds automatic navigation through the pages of a book from its list of pages. In future implementations it should be possible to generate this list automatically (by the prefix), and organize from a special page.


  1. Download a snapshot and extract it to your extensions directory. Choose the version that matches your version of MediaWiki.
  2. Add
    require_once( "$IP/extensions/BookManager/BookManager.php" );
    to the bottom of LocalSettings.php.
  3. Installation can now be verified through Special:Version of your wiki.

Download from svn[edit]

You can also use the following command in your extensions folder:

# svn checkout http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/BookManager/ 


MediaWiki messages[edit]

Parameter Default Explanation
$wgBookManagerPrefixNamespace[1] NS_PROJECT This variable defines the namespace name which will be used to store the list of chapters of each book (if MediaWiki:coll-community_book_prefix is left blank). Its value is combined with the text of MediaWiki:coll-collections to define the common prefix used for all lists.

Example: If $wgBookManagerPrefixNamespace = NS_PROJECT and MediaWiki:coll-collections has the text "Book", then the list of chapters of a book called "Foo" should be saved on page "Project:Book/Foo".

$wgBookManagerNavBar true Indicates whether the navigation bar should be added to the chapters of a book or not
$wgBookManagerNamespaces array( NS_MAIN )[2] An array of namespaces where the navigation bar can be displayed
$wgBookManagerVariables true Indicates whether the extension should provide additional #variables for the users

MediaWiki messages[edit]

Message Default Explanation
MediaWiki:coll-collections[1] empty These messages[3] are used in conjunction with $wgBookManagerPrefixNamespace to determine the common prefix used for all chapter lists. The prefix can be either:
  • Completely defined by the value of MediaWiki:coll-community_book_prefix; or
  • The concatenation of $wgBookManagerPrefixNamespace and MediaWiki:coll-collections, followed by a bar "/"
MediaWiki:coll-community_book_prefix[1] empty


The first step is to create the list of chapters which belongs to a book.

List of chapters[edit]

The syntax and the page used to keep the list are the same used by Extension:Collection (see also Collection Help on Wikibooks):

:[[Book name/chapter name|chapter name]]
:[[Book name/another chapter name|another chapter name]]

Once the list is created, the extension will provide you some features for your book:

Automatic navigation[edit]

It will be possible to navigate through the pages of the book with a navigation bar like the following, which can be customized using CSS or editing the the MediaWiki messages where they are defined:

BookManger navigation bar


The extension also provides some variables, which can be used along the book chapters:

Variable Description
{{PREVPAGENAME}} get the name of previous chapter page from chapter's list
{{PREVPAGENAMEE}} get the encoded name of previous page from chapter's list
{{NEXTPAGENAME}} get the name of next page from chapter's list
{{NEXTPAGENAMEE}} get the encoded name of next page from chapter's list
{{ROOTPAGENAME}} get the name of root page
{{ROOTPAGENAMEE}} get the encoded name of root page
{{CHAPTERNAME}} get the name of current chapter
{{CHAPTERNAMEE}} get encoded name of current chapter
{{RANDOMCHAPTER}}[4] get the name of a random chapter from chapter's list
{{RANDOMCHAPTERE}}[4] get encoded name of a random chapter from chapter's list (it is a random value unlike {{RANDOMCHAPTER}})

Automatic print version[edit]

The page Special:PrintVersion of your wiki can be used to get a print version of a book, with all its pages into one only page. If you have a book called "Introduction to Sociology", you can go to

Special:PrintVersion/Introduction to Sociology

which accepts the url parameter printable=yes to show the page in a form that is suitable for printing. The book name can also be provided by the url parameter book, as in

http://www.mediawiki.org/wiki/Special:PrintVersion?book=Introduction to Sociology

Future improvements[edit]


  1. 1.0 1.1 1.2 This component will be obsolete when it was implemented the navigation through categories
  2. This should defaults to $wgContentNamespaces instead of array( NS_MAIN )(Bug 30994)
  3. In future versions, these messages should be renamed to avoid conflicts with Extension:Collection, and should default to the same value used by that extension (Bug 30995)
  4. 4.0 4.1 the magic word will be replaced by a special page(Bug 31003)

See also[edit]