Difference between revisions of "Template:See also"

From Canonical Works Universe Wiki

m (1 revision imported)
(Replaced content with "<includeonly>{{#invoke:Labelled list hatnote|labelledList|See also}}</includeonly><noinclude> {{documentation}} <!-- Categories go on the /doc subpage, and interwikis go o...")
 
Line 1: Line 1:
<languages/>
+
<includeonly>{{#invoke:Labelled list hatnote|labelledList|See also}}</includeonly><noinclude>
<onlyinclude>{{#switch:<translate></translate>
+
{{documentation}}
| =
+
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
{{rellink|extraclasses=mw-tpl-seealso|{{{altphrase|<translate><!--T:1--> See also</translate>}}}: {{#if:{{{1<includeonly>|</includeonly>}}} |<!--then:-->[[:{{{1}}}{{#if:{{{label 1|{{{l1|}}}}}}|{{!}}{{{label 1|{{{l1}}}}}}}}]] |<!--else:-->'''<translate><!--T:2--> Error: [[<tvar|1>Special:MyLanguage/Template:See also</>|Template must be given at least one article name]]</translate>'''
+
</noinclude>
}}{{#if:{{{2|}}}|{{#if:{{{3|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{2}}}{{#if:{{{label 2|{{{l2|}}}}}}|{{!}}{{{label 2|{{{l2}}}}}}}}]]
 
}}{{#if:{{{3|}}}|{{#if:{{{4|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{3}}}{{#if:{{{label 3|{{{l3|}}}}}}|{{!}}{{{label 3|{{{l3}}}}}}}}]]
 
}}{{#if:{{{4|}}}|{{#if:{{{5|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{4}}}{{#if:{{{label 4|{{{l4|}}}}}}|{{!}}{{{label 4|{{{l4}}}}}}}}]]
 
}}{{#if:{{{5|}}}|{{#if:{{{6|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{5}}}{{#if:{{{label 5|{{{l5|}}}}}}|{{!}}{{{label 5|{{{l5}}}}}}}}]]
 
}}{{#if:{{{6|}}}|{{#if:{{{7|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{6}}}{{#if:{{{label 6|{{{l6|}}}}}}|{{!}}{{{label 6|{{{l6}}}}}}}}]]
 
}}{{#if:{{{7|}}}|{{#if:{{{8|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{7}}}{{#if:{{{label 7|{{{l7|}}}}}}|{{!}}{{{label 7|{{{l7}}}}}}}}]]
 
}}{{#if:{{{8|}}}|{{#if:{{{9|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{8}}}{{#if:{{{label 8|{{{l8|}}}}}}|{{!}}{{{label 8|{{{l8}}}}}}}}]]
 
}}{{#if:{{{9|}}}|{{#if:{{{10|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{9}}}{{#if:{{{label 9|{{{l9|}}}}}}|{{!}}{{{label 9|{{{l9}}}}}}}}]]
 
}}{{#if:{{{10|}}}|{{#if:{{{11|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{10}}}{{#if:{{{label 10|{{{l10|}}}}}}|{{!}}{{{label 10|{{{l10}}}}}}}}]]
 
}}{{#if:{{{11|}}}|{{#if:{{{12|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{11}}}{{#if:{{{label 11|{{{l11|}}}}}}|{{!}}{{{label 11|{{{l11}}}}}}}}]]
 
}}{{#if:{{{12|}}}|{{#if:{{{13|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{12}}}{{#if:{{{label 12|{{{l12|}}}}}}|{{!}}{{{label 12|{{{l12}}}}}}}}]]
 
}}{{#if:{{{13|}}}|{{#if:{{{14|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{13}}}{{#if:{{{label 13|{{{l13|}}}}}}|{{!}}{{{label 13|{{{l13}}}}}}}}]]
 
}}{{#if:{{{14|}}}|{{#if:{{{15|}}}|{{int|comma-separator}}|<nowiki/>{{int|and}}{{int|word-separator}}}} [[:{{{14}}}{{#if:{{{label 14|{{{l14|}}}}}}|{{!}}{{{label 14|{{{l14}}}}}}}}]]
 
}}{{#if:{{{15|}}}|{{int|and}}{{int|word-separator}}[[:{{{15}}}{{#if:{{{label 15|{{{l15|}}} }}}|{{!}}{{{label 15|{{{l15|}}} }}} }}]]
 
}}{{#if:{{{16|}}}| &mdash; '''<br/><translate><!--T:3--> Error: [[<tvar|1>Special:MyLanguage/Template:See also</>|Too many links specified (maximum is 15)]]</translate>'''
 
}}}}
 
| #default=
 
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:See also|noshift=1}}
 
}}</onlyinclude>
 
{{ {{TNTN|Documentation}} |content=
 
 
 
<translate>
 
==Usage== <!--T:4-->
 
 
 
<!--T:5-->
 
<tvar|1>{{tlx|See also}}</> is used to create [[w:Wikipedia:Hatnote|hatnotes]] to point to a small number of other, related, titles at the '''top''' of [[w:Help:Section|article sections]] according to [[w:Wikipedia:Layout|Wikipedia:Layout]].</translate>
 
<translate>
 
<!--T:6-->
 
It is not for use in the "See also" ''section'' at the bottom of an article.
 
</translate>
 
 
 
{{Tlx|See also|<translate><!--T:7--> Article 1</translate>|...|''<translate><!--T:8--> Article 15</translate>''}}
 
 
 
<translate>
 
<!--T:9-->
 
* One to fifteen articles can be listed.</translate>
 
<translate>
 
<!--T:10-->
 
* The word "and" is always placed between the final two entries.</translate>
 
<translate>
 
<!--T:11-->
 
* If more than 15 entries are supplied, a message will be displayed pointing out the problem.</translate><!-- this is relatively ungraceful failure -->
 
<translate>
 
<!--T:12-->
 
* You can use parameters label 1 to label 15 to specify alternative labels for the links.
 
</translate>
 
:<translate><!--T:13--> adding newline characters will break article links</translate> <!-- presumably because of the leading ":" -->
 
 
 
<translate>
 
==Example== <!--T:14-->
 
</translate>
 
<table class="wikitable" cellspacing="0" cellpadding="0">
 
<tr>
 
<th><translate><!--T:15--> Code</translate></th>
 
<th><translate><!--T:16--> Result</translate></th>
 
</tr><tr>
 
<td valign="top">{{Tlx|See also|Article}}</td><td>{{See also|Article}}</td>
 
</tr><tr>
 
<td valign="top">{{Tlx|See also|Article|3=label 1=<translate><!--T:17--> Alternative title for Article</translate>}}</td><td>{{See also|Article|label 1=<translate><!--T:18--> Alternative title for Article</translate>}}</td>
 
</tr><tr>
 
<td valign="top">{{Tlx|See also|Article|Article 2}}</td><td>{{See also|Article|Article 2}}</td>
 
</tr><tr>
 
<td valign="top">{{Tlx|See also|Article|Article 2|Article 3}}</td><td>{{See also|Article|Article 2|Article 3}}</td>
 
</tr><tr>
 
<td valign="top">{{Tlx|See also|Article|Article 2|4=label 2=<translate><!--T:19--> Alternative title for Article 2</translate>}}</td><td>{{See also|Article|Article 2|label 2=<translate><!--T:20--> Alternative title for Article 2</translate>}}
 
</tr>
 
</table>
 
''<translate><!--T:21--> And so on up to 15 parameters.</translate>''
 
 
 
{{See also/doc}}
 
 
 
}}
 
[[Category:Templates{{#translation:}}]]
 

Latest revision as of 22:20, 15 January 2019

50px Template documentation[view] [[index.php?title=Template:See_also/doc&action=edit edit]] [[index.php?title=Template:See_also/doc&action=history history]] [[index.php?title=Template:See_also&action=purge purge]]

This template is used to create hatnotes to point to a small number of other related titles at the top of article sections (excluding the lead) according to Wikipedia:Layout. It looks like this:

Do not use this template inside the "See also" section at the end of an article, or for links to other articles or subsections of the same article within regular article text. Where subsections are linked to, Template:Section link may be suitable instead.

Refer to the examples below to see how the template handles link targets containing section links and commas.

Usage

Basic usage
{{See also|page1|page2|page3|...}}
All parameters
{{See also|page1|page2|page3| ...
|label 1 = label 1|label 2 = label2|label 3 = label3| ...
|l1 = label1|l2 = label2|l3 = label3| ...
|selfref = yes|category = no}}

Parameters

This template accepts the following parameters:

  • 1, 2, 3, ... – the pages to link to. At least one page name is required. 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.
  • label 1, label 2, label 3, ...; or l1, l2, l3, ...; optional labels for each of the pages to link to.
  • 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.
  • category – if set to "no", "n", "false", or "0", suppresses the error tracking category (Category:Hatnote templates with errors). This only has an effect if the first positional parameter (the page to link to) is omitted.

Examples

Errors

If no page names are supplied, the template outputs the following message with the (help) wikilink pointing to this very Errors section:

  • Error: no page names specified (help).

If you see this error message, it is for one of three reasons:

  1. No parameters were specified (the template code was {{See also}} with no pipe character nor page to link to). Please use {{See also|page}} instead.
  2. Some parameters were specified, but no page names were included. For example, the template text {{See also|selfref=yes}} will produce this error. Please use (for example) {{See also|page|selfref=yes}} instead.
  3. A page name was specified, but it contains an equals sign ("="). The equals sign has a special meaning in template code, and because of this it cannot be used in template parameters that do not specify a parameter name. For example, the template code {{See also|1+1=2|2+2=4}} will produce this error. To work around this, you can specify the parameter name explicitly by using 1=, 2, etc., before the page name, like this: {{See also|1=1+1=2|2=2+2=4}}.

If you see this error message and are unsure of what to do, please post a message on the help desk (WP:HD), and someone should be able to help you.

To see a list of wikilinks to articles that contain this error message, see the maintenance category: Category:Hatnote templates with errors.

TemplateData

TemplateData documentation used by VisualEditor and other tools
See the monthly error report for this template.

TemplateData for See also

<templatedata> { "description": "This template creates a hatnote to point to a small number of related pages. It is placed at the top of a section, directly underneath the section heading.", "params": { "1": { "label": "Page 1", "description": "The name of the first page that you want to link to.", "type": "wiki-page-name", "required": true, "example": "Article name" }, "2": { "label": "Page 2", "description": "The name of the second page that you want to link to.", "type": "wiki-page-name", "required": false }, "3": { "label": "Page 3", "description": "The name of the third page that you want to link to. More pages can be added using the parameters \"4\", \"5\", \"6\", etc.", "type": "wiki-page-name", "required": false }, "label 1": { "label": "Label 1", "type": "string", "description": "What the first linked article is to be displayed as. ", "aliases": [ "l1" ] }, "label 2": { "label": "Label 2", "type": "string", "description": "What the second linked article is to be displayed as.", "aliases": [ "l2" ] }, "selfref": { "type": "boolean", "label": "Self reference", "description": "Set to \"yes\" if the template is a self-reference to Wikipedia that would not make sense on mirrors or forks of the Wikipedia site.", "example": "yes", "default": "no" }, "category": { "label": "Category", "description": "Set to \"no\", \"n\", \"false\", or \"0\" to suppresses the error tracking category (Category:Hatnote templates with errors). This only has an effect if no page names are specified.", "type": "boolean", "default": "yes", "example": "no" }, "label 3": { "aliases": [ "l3" ], "type": "string", "label": "Label 3", "description": "What the third linked article is to be displayed as. Other labels can be added by using increasing numbers (starting with \"label 4\" or \"l4\" for page 4) as parameter names." } }, "format": "inline" } </templatedata>

See also