Template:Main article
Usage
{{main article}} displays one or more links to point the reader towards the more substantial main article for further reading. The output text is indented and italic.
The template is useful, e.g. when an article section takes up something that already is thoroughly explained in a main article, or when an article includes a citation from another article at MozillaWiki. It is meant to make it easier to include internal references, and to lessen the need for over-extensive article sections and parallel articles.
When the referenced articles reside in the main namespace, the template shows the text "Main article" (if only one article is specified) or "Main articles" (for two articles or more). If, however, the referenced articles are in other namespaces than the main one, or if the included articles are found in both the main and some other namespaces, the template will show "Main page" or "Main pages", for a single reference and multiple references respectively.
Parameters
There are a total of 21 parameters, of which ten are unnamed. The template has one mandatory parameter for specifying the first main article (1
), and 20 optional parameters. Of the latter, nine parameters may be used to specify additional main articles (2
through 10
). There is an option to assign custom link texts to the articles through another ten optional parameters (l1
through l10
), but use of that feature is not recommended. There is also an optional parameter for including a reference to a former (outdated) project wikipage, e.g. when the project's name has changed (old
).
Mandatory parameter
-
1
: The name of the main article
This is the only mandatory parameter. No parameter name needs to be entered. If this parameter is left out, an error message will be displayed.
- Usage
-
{{main article|1}}
Optional parameters
- Additional main articles
-
2
–10
: The names of the main articles
There are nine (9) optional parameters to specify additional main articles. No parameter names need to be entered. The template can't contain more than 10 articles. If that limit is exceeded, an error message will be displayed.
- Usage
-
{{main article|1|2|3|4|5|6|7|8|9|10}}
- Custom link text
-
l1
–l10
: Custom text
There are ten (10) optional parameters to specify custom link texts for any of the referenced main articles. The parameter names use the latin letter "l" (i.e. the lower-case latin letter "L") with the number of the main article to which you want to assign the custom link text; e.g. l1
for adding a custom link text for the first referenced article.
NB! Custom link texts should only be used when absolutely necessary in order to clarify something! The main rule is to always use the articles names used in the wiki.
- Usage
-
{{main article|1|l1=One}}
- Older project wikipage
-
old
: The name of the project's old main article
This is an optional parameter to link to an outdated project wikipage, e.g. when the project's name has changed.
- Usage
-
{{main article|1|old=Zero}}
Examples
Correct use
- Schematic examples
Example case | Code | Output |
---|---|---|
1 article | {{main article|1}} |
|
2–10 articles | {{main article|1|2|3|4|5|6|7|8|9|10}} |
|
1 article with custom link text | {{main article|1|l1=a}} |
|
2–10 articles with custom link texts | {{main article|1|2|3|4|5|6|7|8|9|10 |
- Textual examples
Example case | What you write | What you see |
---|---|---|
1 article | {{main article|Contribute}} |
|
1 article with custom link text | {{main article|Contribute|l1=Join Mozilla}} |
|
2 articles | {{main article|Contribute|Firefox}} |
|
2 articles with custom link texts | {{main article|Contribute|l1=Join Mozilla|Firefox|l2=Web browser}} |
|
1 article outside the main namespace | {{main article|MozillaWiki:About}} |
|
2 articles outside the main namespace | {{main article|MozillaWiki:About|MozillaWiki:Accounts}} |
|
1 article within and 1 article outside the main namespace | {{main article|Contribute|MozillaWiki:About}} |
|
Outdated main article | {{main article|Android|old=Fennec}} |
Incorrect use
Example case | What you write | What you see (error message) |
---|---|---|
> 10 articles | {{main article|1|2|3|4|5|6|7|8|9|10|11}} |
|
No parameter | {{main article}} |
See also
- {{main}} – simple template for referencing only one main article.
The above documentation is transcluded from Template:Main article/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |