Template:Main article/doc: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Corrections and general improvements.)
(Additional corrections.)
Line 15: Line 15:
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.
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:
;Usage:
* <code><nowiki>{{</nowiki>main article|'''1'''<nowiki>}}</nowiki></code>
* <code><nowiki>{{</nowiki>main article|'''1'''<nowiki>}}</nowiki></code>


Line 21: Line 21:
;<big>Additional main articles</big>
;<big>Additional main articles</big>
* '''<code>2</code>–<code>10</code>''': The names of the main articles
* '''<code>2</code>–<code>10</code>''': The names of the main articles
There are nine (9) optional parameters to specify additional main articles, {{Nowrap|1=<code>2</code>, <code>3</code>, …, <code>10</code>}} (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.
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:
;Usage:
* <code><nowiki>{{</nowiki>main article|1|'''2'''|'''3'''|'''4'''|'''5'''|'''6'''|'''7'''|'''8'''|'''9'''|'''10'''<nowiki>}}</nowiki></code>
* <code><nowiki>{{</nowiki>main article|1|'''2'''|'''3'''|'''4'''|'''5'''|'''6'''|'''7'''|'''8'''|'''9'''|'''10'''<nowiki>}}</nowiki></code>


;<big>Custom link text</big>
;<big>Custom link text</big>
* '''<code>l1</code>–<code>l10</code>''': Custom text
* '''<code>l1</code>–<code>l10</code>''': 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. lower-case "L") with the number of the main article to which you want to assign the custom link text: {{Nowrap|1=<code>l1</code>, <code>l2</code>, …, <code>l10</code>}}.
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. <code>l1</code> for adding a custom link text for the first referenced article.


'''NB!''' Custom link text should only be used when absolutely necessary in order to clarify something! The main rule is to ''always'' use the main articles names as they are in the wiki.
'''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:
;Usage:
* <code><nowiki>{{</nowiki>main article|1|'''l1='''One<nowiki>}}</nowiki></code>
* <code><nowiki>{{</nowiki>main article|1|'''l1='''One<nowiki>}}</nowiki></code>


;<big>Scientific names</big>
;<big>Scientific names</big>
* '''<code>latin</code>''': Scientific name of the organism the main article covers
* '''<code>latin</code>''': Scientific name of the organism the main article covers
Lastly, there is an optional parameter for denoting scientific names of organisms, <code>latin</code>.
This is an optional parameter for denoting scientific names of organisms.


Usage:
;Usage:
* <code><nowiki>{{</nowiki>main article|1|'''latin='''Species prima<nowiki>}}</nowiki></code>
* <code><nowiki>{{</nowiki>main article|1|'''latin='''Species prima<nowiki>}}</nowiki></code>


Line 72: Line 72:
! Example case !! What you write !! What you see (error message)
! Example case !! What you write !! What you see (error message)
|-
|-
| &gt; 10 articles || <code><nowiki>{{main article|1|2|3|4|5|6|7|8|9|10|11}}</nowiki></code> || {{main article|1|2|3|4|5|6|7|8|9|10|11}}
| &gt; 10 articles || <code><nowiki>{{main&nbsp;article|1|2|3|4|5|6|7|8|9|10|11}}</nowiki></code> || {{main article|1|2|3|4|5|6|7|8|9|10|11}}
|-
|-
| No&nbsp;parameter || <code><nowiki>{{main article}}</nowiki></code> || {{main article}}
| No&nbsp;parameter || <code><nowiki>{{main article}}</nowiki></code> || {{main article}}

Revision as of 21:03, 28 October 2014

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 ment 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 more than one articles). If, however, the referenced articles are in other namespaces than the main one, or if the articles are 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 scientific names (latin).

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}}
Scientific names
  • latin: Scientific name of the organism the main article covers

This is an optional parameter for denoting scientific names of organisms.

Usage
  • {{main article|1|latin=Species prima}}

Examples

Correct use

Example case What you write What you see
≤ 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 {{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
Scientific name {{main article|Fennec|latin=Vulpes zerda}}
Main article: 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