Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Main

Permanently protected template
From Wikipedia, the free encyclopedia
Template documentation[view] [edit] [history] [purge]
This template is for linking to main content. For the mainspace detection template, seeTemplate:Main other.
WarningThis template is used onapproximately 379,000 pages.
To avoid major disruption and server load, any changes should be tested in the template's/sandbox or/testcases subpages, or in your ownuser subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on thetalk page before implementing them.
This templateshouldnot besubstituted.
This template usesLua:

When aWikipedia article is large, it is often written insummary style. Thistemplate is used after the heading of the summary, to link to the subtopic article that has been summarized. ForCategory namespace, please use{{Cat main}} instead.

Use of this template should be restricted to the purposes described above. It isnot to be used as a substitute for inline links or{{Further}} template. The latter is used when the section expounds a specific aspect of the topic instead of summarizing its article. For example, inphthalate, the template under the "Endocrine disruptor" section shouldnot be{{Main|Endocrine disruptor}}, because the section specifically deals with phthalate as an endocrine disruptor and not endocrine disruptors in general.

Do not use this template on top of a page (such as above the lead), where hatnotes are for disambiguation and not for related topics (according toWP:RELATED). A lead section is always a summary of its own article, not any other; as such, the only appropriate target for a{{Main}} link in the lead section would be the article itself, which is not useful.

Usage

Further information:WP:SUMMARYHATNOTE
  • Basic usage:{{Main|page}}
  • All parameters:{{Main|page1|page2|page3| ... |l1 = label1|l2 = label2|l3 = label3| ... |selfref = yes}}

Parameters

  • 1,2,3, ... – the pages to link to. If no page names are specified, the current page name is used instead (without thenamespace prefix). Categories and files are automatically escaped with thecolon trick, and links to sections are automatically formatted aspage § section, rather than the MediaWiki default ofpage#section.
  • l1,l2,l3, ...orlabel 1,label 2,label 3, ... – optional labels for each of the pages to link to (this is for articles where a piped link would be used). Note that the extra parameters use a lower case 'L', for example,l1,notL1.
  • selfref – if set to "yes", "y", "true" or "1", adds the CSS class "selfref". This is used to denote self-references to Wikipedia. SeeTemplate:Selfref for more information. This is only necessary in articles and other content (e.g. templates) that will appear in articles, and need not be added for uses of this template onWikipedia: namespace pages.

Template data

This is theTemplateData for this template used byTemplateWizard,VisualEditor and other tools.See a monthly parameter usage report forTemplate:Main in articles based on its TemplateData.

TemplateData for Main

This template is used after the heading of a section, to link to a sub-article (or sub-articles) that is entirely about the topic of the section. The template will display, in italics, "Main article: Article 1, Article 2 and Article 3"

Template parameters[Edit template data]

This template has custom formatting.

ParameterDescriptionTypeStatus
Page 11

The name of the first page that you want to link to. If this is not specified, the current page name (with no namespace prefix) is used instead.

Page namerequired
Page 22

The name of the second page that you want to link to.

Page nameoptional
Page 33

The name of the third page that you want to link to. More pages can be added using the parameters "4", "5", etc.

Page nameoptional
Page 44

The name of the fourth page that you want to link to.

Page nameoptional
Page 55

The name of the fifth page that you want to link to.

Page nameoptional
Label 1l1label 1

What the first linked page is to be displayed as.

Stringoptional
Label 2l2label 2

What the second linked page is to be displayed as.

Stringoptional
Label 3l3label 3

What the third linked page is to be displayed as. Other labels can be added by using increasing numbers (starting with "l4" for page 4) as parameter names.

Stringoptional
Label 4l4label 4

What the fourth linked page is to be displayed as.

Stringoptional
Label 5l5label 5

What the fifth linked page is to be displayed as.

Stringoptional
Self referenceselfref

Set to "yes" if the template is a self-reference to Wikipedia that would not make sense on mirrors or forks of the Wikipedia site.

Booleanoptional

Examples

Underscores (_) between words are not necessary

Errors

If the name of the first page that you want to link to is not specified, the current page name (with no namespace prefix) is used instead:

  • Error: no page names specified (help).

No errors can be displayed due to the illegal usage of parameters or other usages (i.e. the first parameter can be omitted, other parameters can be used even if the first one is empty (and automatically filled with the current page name (with no namespace prefix)), equals sign can be used as one of the parameters, and template can be used by direct call to the module (using "#invoke")). This is not the case for{{see also}}, for example.

See also

  • {{Main list}}: For a more comprehensive list, seeArticle.
  • {{Broader}}: For broader coverage of this topic, seeArticle.
  • {{Excerpt}}, which allows transclusion of text (such as an intro section) from one article into another
  • {{Further}}: Further information:Article.
  • {{Official website}}
Generic
For and about
Variations
Other topics
Redirect
Distinguish
For use in sections
Special
Subject specific
The abovedocumentation istranscluded fromTemplate:Main/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Main&oldid=1054074732"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp