Open main menu

Extension:SubpageIndex

MediaWiki extensions manual
OOjs UI icon advanced.svg
SubpageIndex
Release status: stable
Implementation Tag
Description Adds parser tag which provides (css) themable list of subpages for the current or specified page.
Author(s) Evan King (HonoredMuletalk)
Latest version 0.9 (2011-07-05)
MediaWiki 1.16+
License LGPL
Download Page
Example Arcanum Illyria
SubpageIndex PageTOC
1.16.3
Translate the SubpageIndex extension if it is available at translatewiki.net
Check usage and version matrix.

SubpageIndex is a minimalistic extension for listing subpages. It provides a pagename-labeled and hyphen-delimited horizontal list of subpage links either for the current page, another page in the current namespace, or another page in a specified namespace. The output is wrapped in a div with css class "embed" for styling in a custom skin, but switching to hard-coded styles or other classes would be a simple matter (one-line edit).

The link text excludes common roots (i.e. "Parent/subpage" will list as "subpage") and links to the current page will be replaced with non-linked bold text in wikilink fashion.

Contents

UsageEdit

DirectEdit

On the page with subpages only:

<SubpageIndex /> or <PageTOC />

On any page:

<SubpageIndex>[Namespace:]Pagename</SubpageIndex>

or

<PageTOC>[Namespace:]Pagename</PageTOC>

TemplateEdit

First, create your template with <SubpageIndex>{{{1|{{FULLPAGENAME}}}}}</SubpageIndex> and then reference it accordingly as desired (i.e. {{PageTOC|[Namespace:]Pagename}}).

Known Issues/Missing FeaturesEdit

  • Specifying user-defined namespaces isn't working (even though it should be). Under investigation. (Implicit use of current namespace does work even for user-defined namespaces.)
  • Implying current page and namespace isn't working for the template in user-defined namespaces. Workaround is to specify current page only or use the tags.
  • Adding and removing sub-pages does not (yet) automatically clear invalidated cache.
  • There is no depth control (script assumes you want all nested subpages). Future versions may automatically switch to nested unordered lists (possibly turned into css menus) when depth > 1 is detected and not filtered out.

While there is much more that could be done to make SubpageIndex more robust and useful, it already exceeds my own needs and other such feature-rich extensions already exist. Nevertheless, I may continue to improve this one from time to time, and will be actively maintaining it for my own sites.