Difference between revisions of "Template:Main/doc"

m (1 revision)
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Lua|icononly=on|Module:Main}}
 
{{Lua|icononly=on|Module:Main}}
  
When a [[Wikipedia:What is an article|Wikipedia article]] is large, it is often rewritten in [[Wikipedia:summary style|summary style]]. This [[Wikipedia:Template messages|template]] is used after the heading of the summary, to link to the sub-article that has been (or will be) summarised. This template can also be used in the [[Help:Category|Category namespace]], but the preferred template for categories is '''{{tl|Cat main}}'''.
+
When an article is large, it is often written in summary style. This template is used after the heading of the summary, to link to the sub-article that has been summarized. For [[w:Help:Category|Category namespace]], please use '''{{tl|Cat main}}''' instead.
  
This template can also be used in articles leads when an article is not the "main" article for its subject, but this is controversial. When there are multiple articles, distinct enough to warrant separate articles, but not enough to be very separate subjects. One to be the main article describing the topic, and the others avoiding unnecessary duplication of the main article. A good example would be geography articles where two terms have somewhat different meanings or "contexts", but refer to roughly the same geographic area, e.g. [[Balkans]] and [[Southeast Europe]]. The Balkans article is the main article, the Southeast Europe article doesn't try to be a duplicate of the Balkans article by having much info on History, natural resources, etc., it leaves that to the Balkans article. This can be thought of as a halfway point between having fully separate articles, and having a redirect.
+
Use of this template should be restricted to the purposes described above. It is '''not''' to be used as a substitute for inline links or {{tl|Further}} template. The latter is used when the section expounds a specific aspect of the topic instead of summarizing its article.
 
 
Its usage should be restricted to the purposes described above. This template is '''not''' to be used as a substitute for inline links or as a "[[Template:See also|see also]]". The latter includes e.g. when a section has a title that happens to have a main article, but the section actually refers to a specific aspect of the article at hand. In [[Phthalate]], for example, the template under the section ''Endocrine disruptor'' should '''not''' be ''Main: Endocrine disruptor'', because the section specifically deals with phtalate as an endocrine disruptor and not endocrine disruptors in general.
 
  
 
{{TOC limit}}
 
{{TOC limit}}
  
 
== Usage ==
 
== Usage ==
 
+
; Basic usage: {{tlf|main|''page''}}
; Basic usage:
+
; All parameters: {{((}}main | ''page1'' | ''page2'' | ''page3'' | ...  | l1 = ''label1'' | l2 = ''label2'' | l3 = ''label3'' | ... | selfref = ''yes''{{))}}
{{main|''page''}}
 
 
 
; All parameters:
 
{{main
 
| ''page1'' | ''page2'' | ''page3'' | ...
 
  | l1 = ''label1'' | l2 = ''label2'' | l3 = ''label3'' | ...
 
| selfref = ''yes''
 
}}
 
  
 
== Parameters ==
 
== Parameters ==
  
* <code>1</code>, <code>2</code>, <code>3</code>, ... - the pages to link to. If no page names are specified, the current page name is used instead (without the [[WP:NS|namespace]] prefix). Categories and files are automatically escaped with the [[Help:Colon trick|colon trick]], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
+
* <code>1</code>, <code>2</code>, <code>3</code>, ... - the pages to link to. If no page names are specified, the current page name is used instead (without the namespace prefix). Categories and files are automatically escaped with the [[w:Help:Colon trick|colon trick]], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
 
* <code>l1</code>, <code>l2</code>, <code>l3</code>, ...; 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, <code>l1</code>, <u>not</u> <code>11</code>.
 
* <code>l1</code>, <code>l2</code>, <code>l3</code>, ...; 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, <code>l1</code>, <u>not</u> <code>11</code>.
* <code>selfref</code> - if set to "yes", "y", "true" or "1", adds the CSS class "selfref". This is used to denote self-references to Wikipedia. See [[Template:Selfref]] for more information.
 
  
 
== Examples ==
 
== Examples ==
Line 47: Line 36:
 
"description": "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. ",
 
"description": "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. ",
 
"type": "string/line",
 
"type": "string/line",
"required": false
+
"required": false,
 +
"suggested": true
 
},
 
},
 
"2": {
 
"2": {

Latest revision as of 07:07, 11 July 2016

When an article is large, it is often written in summary style. This template is used after the heading of the summary, to link to the sub-article that has been summarized. For Category namespace, please use {{Cat main}} instead.

Use of this template should be restricted to the purposes described above. It is not 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.

Usage[edit]

Basic usage
{{main|page}}
All parameters
{{main | page1 | page2 | page3 | ... | l1 = label1 | l2 = label2 | l3 = label3 | ... | selfref = yes}}

Parameters[edit]

  • 1, 2, 3, ... - the pages to link to. If no page names are specified, the current page name is used instead (without the namespace prefix). Categories and files are automatically escaped with the colon trick, and links to sections are automatically formatted as page § section, rather than the MediaWiki default of page#section.
  • l1, l2, l3, ...; 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, not 11.

Examples[edit]