Jump to content

Help:All pages with prefix

From mediawiki.org
(Redirected from All pages with prefix)
PD Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info. PD

All pages with prefix is a special page that lists all the pages in the wiki beginning with a specified prefix, optionally filtered by namespace, optionally hiding redirects. It can be used as shown in the examples below to render a bulleted list of all pages under a parent page, or some other arbitrary page on the wiki.

This feature is accessible at Special:PrefixIndex.

Transclusion

[edit]

This special page can be transcluded.

The page prefix, if specified, should follow after a / character as in the examples below.

{{Special:PrefixIndex/Special pages}}

If a namespace appears at the beginning, followed by a colon (e.g. Help:) then that is used as the namespace parameter:

{{Special:PrefixIndex/Help:Special pages}}

Other options follow after the namespace + page and are separated by pipes (|):

{{Special:PrefixIndex/Help:Special pages/|stripprefix=1}}

Note that a trailing slash is significant in the example above.

Examples

[edit]
What you type What you get
{{Special:PrefixIndex/Special pages}}

Note how the page itself, Special pages is also included in the list.

{{Special:PrefixIndex/Special pages|stripprefix=1}}
{{Special:PrefixIndex/Special pages/|stripprefix=1}}

Note how the parent page is now absent from the list.

Note about listing entire namespaces

[edit]

You can list out all pages in a namespace with {{Special:PrefixIndex/Namespace:}}. Note that this will not include the Namespace: prefix on each of the list items.

If you want the namespace prefix, try {{Special:AllPages|namespace=<nsid>}} or {{Special:AllPages/Namespace:}} instead.

To get the namespace number for a specific page, you can use the {{NAMESPACENUMBER:}} magic word, which takes a page name as its argument, like so:

{{Special:AllPages|namespace={{NAMESPACENUMBER:{{FULLPAGENAME}}}}}}

Parameters

[edit]
parameter value type description
hideredirects Boolean (0 or 1) Hide any redirects in the list of matching pages
stripprefix Boolean (0 or 1) Strip the prefix part from each item in the list; if listing subpages of a page, include a trailing slash (/) to exclude the page itself from the list
namespace string Restrict the results to the named namespace

See also

[edit]