Template:Main article/doc

From MozillaWiki
Jump to: navigation, search
Edit-copy green.svg
This is a documentation subpage for Template:Main article.
It contains usage information, categories and other content that is not part of the original template page.

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
  • 210: 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
  • l1l10: 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}}
Main article: 1
2–10 articles {{main article|1|2|3|4|5|6|7|8|9|10}}
Main articles: 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10
1 article with custom link text {{main article|1|l1=a}}
Main article: a
2–10 articles with custom link texts {{main article|1|2|3|4|5|6|7|8|9|10
|l1=a|l2=b|l3=c|l4=d|l5=e|l6=f|l7=g
|l8=h|l9=i|l10=j}}
Main articles: a, b, c, d, e, f, g, h, i and j
Textual examples
Example case What you write What you see
1 article {{main article|Contribute}}
Main article: Contribute
1 article with custom link text {{main article|Contribute|l1=Join Mozilla}}
Main article: Join Mozilla
2 articles {{main article|Contribute|Firefox}}
Main articles: Contribute and Firefox
2 articles with custom link texts {{main article|Contribute|l1=Join Mozilla|Firefox|l2=Web browser}}
Main articles: Join Mozilla and Web browser
1 article outside the main namespace {{main article|MozillaWiki:About}}
Main page: 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}}
Main pages: Contribute and MozillaWiki:About
Outdated main article {{main article|Android|old=Fennec}}
Main article: Android (old main page: 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}}
Error in {{main article}}: Too many articles. The template can't handle more than 10 articles.
No parameter {{main article}}
Error in {{main article}}: No parameter specified. You have to include at least one article name.

See also

  • {{main}} – simple template for referencing only one main article.