Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Help:Subpages

From mediawiki.org
Translate this page
Languages:
PDNote: When you edit this page, you agree to release your contribution under theCC0. SeePublic Domain Help Pages for more info.PD

Subpages introduce some hierarchical organization into wiki pages, with levels of the hierarchy separated by slashes (/).

Where it works

By default, MediaWiki's subpage feature is turned off in the main namespace, but can be used ontalk pages anduser pages.SeeHelp:Namespaces for description of namespaces and$wgNamespacesWithSubpages to learn how to modify this default behavior.In namespaces where the feature is switched off, any forward slashes (/) within a page name are simply part of the page name and do nothing special.

When subpages are enabled in a namespace, a forward slash in the title of a page always causes the page to be a subpage. If this is not desired, you can#Bypass subpages using alternative characters.

How it works

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

Page relationships
Help:Subpages/sub/sub/subi/sub/sub1/sub/sub/sub1/sub/sub
CURRENT PAGEchildgrandchildgreat grandchildgreat great grandchild
parentCURRENT PAGEchild 1grandchildgreat grandchild
child 2grandchildgreat grandchild
grandparentparentCURRENT PAGEchildgrandchild
great grandparentgrandparentparentCURRENT PAGEchild
great great grandparentgreat grandparentgrand-parentparentCURRENT PAGE

You can link directly to any page’s subpage using the normaldouble square brackets notation, by providing the full name – including the slash(es) and the individual subpage name(s).You can also link from one page to one ofits own subpages using certain shortcuts, which are covered atHelp:Links.

There areMagic words to split the name of a subpage, such as{{BASEPAGENAME}} and{{SUBPAGENAME}}, and the parser function{{#titleparts:}} for finer control.

Note that the part of page names after a slash is case sensitiveincluding the first letter.

Breadcrumb links will appear automatically at the top of the subpage, linking to each parent page that exists. These links do not appear, however, if the parent pages have not yet been created or if the subpage feature is turned off.

As these automatic breadcrumb links are not in the page content, the breadcrumbs do not place parent pages in theWhat links here andRelated changes lists.

If youmove (rename) a parent page, you will be shown a list of the subpages, and users with themove-subpagesuser right will have the option to automatically move subpages (up to 100).

Use of subpages

There are various uses for the subpage feature. Some of the typical usages of subpages are:

  • to create archives of old discussions under atalk page
  • to create scratchpad editing spaces under auser page
  • to create other-language versions of a document in multilingual wikis
  • to create a template's subpages for its documentation, for its code sandbox, for its testcases, and for any subtemplate code

Subpages are useful for organising information hierarchically.On the other hand, subpages tend to have a long name that is hard to remember, so it may be more user-friendly to use them as little as possible.You can also organize pages with thecategory feature, which is more suitable for creating a hierarchical network of information.

Displaying subpages

Subpages can be listed very plainly by transcludingSpecial:PrefixIndex, like this:

{{Special:PrefixIndex/Help:Subpages/}}

Which produces this:

Since themagic word{{FULLPAGENAME}} outputs the current page, the general wiki markup to show all subpages of the current page is{{Special:PrefixIndex/{{FULLPAGENAME}}/}}.You can pass parameters to this, e.g.{{Special:PrefixIndex/{{FULLPAGENAME}}/ |hideredirects=1 |stripprefix=1}}

Thesubpage extensions, such asExtension:SubPageList orExtension:SubpageNavigation, let you customize the display of subpages.

Bypass subpages using alternative characters

As a consequence of the forward slash being a reserved character when subpages are enabled, an alternative character might be needed.Back slashes (\) are treated as normal characters in subpage naming and can be used in place of forward slashes.Additionally, as a crude hack, a character similar to the forward slash can be used instead, such as the "big solidus" (U+29F8), which results in Foo⧸bar (cf. a real slash: Foo/bar), or thesolidus (U+2044), which results in Foo⁄bar.Three possible technical disadvantages (apart from the visual difference from a real slash) arise from this hack:

  1. People without the necessary fonts won’t be able to view the character properly;
  2. Redirects from the title with a slash must be created, so that linking and search will work correctly.
  3. Both thesubject and talk versions of a page (and their corresponding subpages, e.g. discussion archives) need to use the hack, so that moving a page would take all connected pages to the new title (if that setting is selected during the move). For example, subpages are disabled in the main namespace in Wikipedia, so while the talk page won't work unless the solidus character is used to prevent having them marked as subpages, the corresponding page in the main namespace could accidentally keep an actual slash. The risk is that the visual similarity might make this go unnoticed by human editors.

See also

Retrieved from "https://www.mediawiki.org/w/index.php?title=Help:Subpages&oldid=7724352"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp