Difference between revisions of "Template:Main/doc"
test>MSGJ (→Examples: upd) |
(view all) |
||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
== Usage == | == Usage == | ||
; Basic usage: {{tlf|main article|''page''}} | ; Basic usage: {{tlf|main article|''page''}} | ||
Revision as of 02:08, 13 January 2016
Contents
Usage
- Basic usage
- {{main article|page}}
- All parameters
- {{main article | 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 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, notL1. (label 1,label 2,label 3, ... for this template does not work)selfref- 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. 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.
Examples
{{main article}}→{{main article|Article}}→{{main article|Article#Section}}→{{main article|Article#Section|l1=Custom section label}}→{{main article|Article1|Article2|Article3}}→{{main article|Article1|l1=Custom label 1|Article2|l2=Custom label 2}}→{{main article|(15760) 1992 QB1|l1={{mp|(15760) 1992 QB|1}}}}→
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:
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 case for {{see also}}, for example.
TemplateData
| ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.
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"
| ||||||||||||||||||||||||||||||||||||||||