Template:Main article/doc: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
__NOTOC__
__NOTOC__
==Usage==
==Usage==
{{tl|main article}} displays one or more links to point the reader towards the more substantial main article for further reading.
{{tl|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.
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.

Revision as of 12:24, 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

The only mandatory parameter is the first one, 1 (no name needs to be entered). If it hasn't been entered, an error message will be displayed.

Usage: {{main article|1}}

Optional parameters

Additional main articles

There are nine (9) optional parameters to specify additional main articles, 2, 3, …, 10 (no 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

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; l1, l2, …, l10.

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.

Usage: {{main article|1|l1=One}}

Scientific names

Lastly, there is an optional parameter for denoting scientific names of organisms, latin.

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

Examples

Example case What you write What you see
no specified param {{main article}}
Error in {{main article}}: No parameter specified. You have to include at least one article name.
param 1 {{main article|Contribute}}
Main article: Contribute
params 1, l1 {{main article|Contribute|l1=To "Contribute"}}
Main article: To "Contribute"
params 1, 2 {{main article|Contribute|Firefox}}
Main articles: Contribute and Firefox
params 1, 2, l1, l2 {{main article|Contribute|l1=To "Contribute"|Firefox|l2=To "Firefox"}}
Main articles: To "Contribute" and To "Firefox"
one article outside the main namespace {{main article|MozillaWiki:About}}
Main page: MozillaWiki:About
two articles outside the main namespace {{main article|MozillaWiki:About|MozillaWiki:Accounts}}
mix of articles within and outside the main namespace {{main article|Contribute|MozillaWiki:About}}
Main pages: Contribute and MozillaWiki:About
≤ 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
> 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.
param latin {{main article|Fennec|latin=Vulpes zerda}}
Main article: Fennec

See also

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