In this blog you will learn what are namespaces, categories, pages, and subpages in MediaWiki, and how they all interact.
Namespace are a high-level collection of pages having special purpose and specific behavior. Mediawiki offers separate namespaces for main content, uploaded files descriptions, user pages, system messages, categories, templates, support content (help pages and project pages), system reports and tools. Namespaces can be searched separately, user permissions to access and edit pages can be fine-tuned by namespace. The important idea behind namespaces isto tell the main content from the auxiliary one. For example, if you create manuals for your wiki editors, it would be a good idea to place them into the “Help” namespace, so readers will not find these pages in search results by default. One can easily recognize the namespace of the current page by prefix, eg:
Pages with the main content are stored in the unprefixed “Main” namespace:
Each namespace – except the “Special” namespace containing system reports and tools – has associated “Talk” namespace allowing to discuss the content of the subject page:
Extensions can define their own namespaces, for example:
Administrators can configure custom namespaces for the purposes of your particular wiki.
Example of Main namespace article
Template namespace page
MediaWiki pages can belong to one or more categories - indexes of related pages. A category is represented by a page in the “Category” namespace, containing a list of all pages tagged with the category name. Being pages, category pages can also be categorized. The hierarchical tree of categories, subcategories and pages can be displayed on a special page (Special:CategoryTree).
MediaWiki Category Page Example
In short, templates are pages for storing reusable content that can be delivered to other pages using the brilliant MediaWiki transclusion technique. The big advantage is that you can customize your template and the changes will be reflected on all pages containing that template.
Smart templates are the great tool for quick creation of professionally looking pages. The template can be given editor-defined options that can pass variable content while maintaining a consistent look and feel for all elements or pages of which the template is a part.
The values of template parameters can be queried by other extensions (eg. DynamicPageList3) and even stored aside of the page content (eg. Semantic MediaWiki) for the fine-grained grouping or filtering of pages. Other extensions (VisualEditor, PageForms) can provide forms for the guided input of the template values.
If enabled in the configuration, subpages add some hierarchical organization to wiki pages. Slashes (/) within a page name break the page into parent and subpages, recursively, e.g.:
This is helpful when there is too much content for one page, or you prefer to add strict structure to your content. Page names in MediaWiki must be unique ( you can read more about MediaWiki Pages here ), but using subpages one can give predictable and not unique names to subpages:
Each subpage provides backlinks to all its ancestors.
MediaWiki navigation by hierarchy example
MediaWiki is all about some magic! There are pre-defined switches, variables, and functions, called “magic words,” that can change the default behavior of MediaWiki on a given page, or retrieve technical information about the page or the entire wiki and make it a part of the page content.
When edited with MediaWiki markup, magic words are text strings in a special format, for example:
These are just a few examples and there are many other magic words you can view here.
For those who prefer to edit pages using VisualEditor, many magic words have been made a part of the editor interface.
A table with data about the wiki using code and magic words
MediaWiki template example rendered
Applying page behavior using VisualEditor interface
Make sure to check out our other MediaWiki blog articles that contain various wiki tutorials and more! If you require any further assistance, have questions, or need MediaWiki support, please do not hesitate to contact us. Our team of experts is eager to provide you with the guidance and expertise you need to make the most out of your MediaWiki installation.
Here’s what we've been up to recently.