Politics
 

Help:Subpages

From Governance Wiki

Subpages introduce some hierarchical organisation into wiki page names, with levels of the hierarchy separated by slashes '/'.

Contents

[edit] Namespaces

Giki's subpage feature is turned off by default in the main namespace, but can be used on talk pages and user pages. See Help:namespaces. In namespaces where the feature is switched off, any slashes (/) within a page name are simply part of the page name and do nothing special.

[edit] Slashes within a page name

Slashes (/) within a page name break the page into parent and subpages, recursively, eg:

Example page
Example page/Some sub-page
Example page/Some sub-page/Some sub-sub-page

A link back to parent will automatically appear at the top of each subpage. In the case of sub-sub-pages, a set of breadcrumb navigation links will automatically be presented. Note that these links do not appear, however, if the parent page has not yet been created.

[edit] Using (and over-using) sub pages

There are various uses for the subpage mechanism. The main two intended uses are:

  • On a talk page create a subpage (or several) for an archiving of old discussions
  • On a user page create a subpage (or several) to use as a scratchpad editing space.

People instinctively think hierarchically when trying to organise information, so it may be tempting to use subpages all the time. However, subpages can be over-used. Remember that having a page name with a slash will generally make the name longer, harder to remember, and thus more difficult to link to. Some people find it more elegant to keep page naming simple. By sticking to a flat naming structure, with a manually maintained web of wiki links, a structure will emerge organically (and this can include a pseudo-hierarchy)


[edit] See also

Contents

An example of a subpage linking to its parent page.

A subpage is a page with a title in the form "Foo/Bar".

Titles like this can always be made, but only for namespaces where the MediaWiki subpage feature is enabled will the following work:

  • "Foo/Bar" can be linked from "Foo" with simply [[/Bar]] .
    • [[/Bar/]] will display as "Bar".
    • Note that if "Foo" is moved to "Foo2" (or any other title), the link [[/Bar]] will then point to "Foo2/Bar" but the subpage will not move automatically, so it will leave a broken link.
  • The subpage will automatically provide a back-link to its parent page, if the parent page exists.

Like normal titles, subpage titles are case sensitive, so Foo/Bar and Foo/bar are different pages.

How do use subpages?

Different wikis may have different policies on when subpages may or may not be used.

A common use is to allowe users to make subpages in their userspace, such as a personal sandbox at [[User:Yourname/sandbox]].

Archives of talk pages are often subpages of the main talk page. For example, [[Talk:Main Page/Archive 1]].

Can I get a list all subpages of a parent page?

You can find the subpages of a specific page by entering the title followed by a forward slash at Special:AllPages on the relevant wiki.

You can also use Special:PrefixIndex to do this. You can even make links like Special:PrefixIndex/Help:Customizing Monaco

(note: This is also show the parent page in the list, if you don't want this, and only want subpages, add a / at the end of the link, like Special:PrefixIndex/Help:Customizing Monaco/)

Why do some people not like subpages?

Note that Wikipedia does not allow subpages in the main article namespace. A case against subpages was made early in the project, and it is generally regarded as easier to link to pages with real titles than to subpages. Therefore, MediaWiki by default only recognizes subpages for talk pages and user pages.

Wikia however has globally enabled subpages on all core namespaces (0-15). If you feel the subpages detrimental to your Wikia's main namespace, please request that the subpage feature be switched off.

By default, any Custom namespaces that are setup do NOT have subpages on by default, You need ask for this during your namespace request.

Can I hide the backlinks to parent pages?

If you find the most prominent aspect of subpages (the parent backlink) to be an annoyance on your Wikia, you can hide it via CSS (add to MediaWiki:Common.css):

body.ns-0 #contentSub .subpages { display:none; }

You can also disable it for other namespaces by changing the ns-# number to the appropriate number (view a page source to find the number of a namespace).

How can I refer to subpages in templates and parserfunctions?

  • The parent and subpage can be referred to via the {{SUBPAGENAME}} and {{BASEPAGENAME}} magic words (more). This can be useful for templates and parserfunctions.
  • If a parent page exists, the #contentSub div will have an extra span in class="subpages". This can be styled via #contentSub .subpages {}.

See also