The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
<noinclude>{{Documentation subpage}}</noinclude> |
|||
The hatnotes used for adding links between articles where more context is important. |
The hatnotes used for adding links between articles where more context is important. |
||
Broadly speaking, a hatnote should answer a readers' question: Am I on the right page? |
Broadly speaking, a hatnote should answer a readers' question: Am I on the right page? |
||
Line 6: | Line 5: | ||
; Basic usage: |
; Basic usage: |
||
{{ |
{{hatnote|''text''}} |
||
; All parameters: |
; All parameters: |
||
{{ |
{{hatnote|''text''|extraclasses=''extra classes''|selfref=''yes''|category=''no''}} |
||
== Parameters == |
== Parameters == |
||
Line 21: | Line 20: | ||
== Example == |
== Example == |
||
* <code><nowiki>{{ |
* <code><nowiki>{{hatnote|Example hatnote text}}</nowiki></code> → {{hatnote|Example hatnote text}} |
||
== Typical types == |
== Typical types == |
||
Line 35: | Line 34: | ||
:*<code>1</code>, <code>2</code>, <code>3</code>, ... – the pages to link to. If no page names are specified, the current page name is used instead (without the namespace prefix). Categories and files are automatically escaped with the [[w:Help:Colon trick|colon trick]], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''. |
:*<code>1</code>, <code>2</code>, <code>3</code>, ... – the pages to link to. If no page names are specified, the current page name is used instead (without the namespace prefix). Categories and files are automatically escaped with the [[w:Help:Colon trick|colon trick]], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''. |
||
:*<code>l1</code>, <code>l2</code>, <code>l3</code>, ... ''or''<code>label 1</code>, <code>label 2</code>, <code>label 3</code>, ... – optional labels for each of the pages to link to (this is for articles where a piped link would be used). Note that the extra parameters use a lower case 'L', for example, <code>l1</code>, <u>not</u> <code>L1</code>. |
:*<code>l1</code>, <code>l2</code>, <code>l3</code>, ... ''or''<code>label 1</code>, <code>label 2</code>, <code>label 3</code>, ... – optional labels for each of the pages to link to (this is for articles where a piped link would be used). Note that the extra parameters use a lower case 'L', for example, <code>l1</code>, <u>not</u> <code>L1</code>. |
||
:*<code>selfref</code> – if set to "yes", "y", "true" or "1", adds the CSS class "selfref". This is used to denote self-references |
:*<code>selfref</code> – if set to "yes", "y", "true" or "1", adds the CSS class "selfref". This is used to denote self-references. |
||
== Disambiguation == |
== Disambiguation == |
||
Templates such as {{T| |
Templates such as {{T|About}} and {{T|For}} are to be used in cases where a disambiguation is not needed. In general, disambiguation pages should only be used for 4 or more titles that are mostly or entirely identical, except for a qualifier. |
||
;{{T| |
;{{T|About}}: Links the reader to other articles with similar titles or concepts that they may have been seeking instead. The template has several formats, including: |
||
:;{{T| |
:;{{T|About|Use1}} →:{{About|}} |
||
:;{{T| |
:;{{T|About|Use1|<nowiki/>|Main Page}} →:{{About|Use1||Main Page}} |
||
:;{{T| |
:;{{T|About|Use1|<nowiki/>|Main Page|and|Main Page}} →:{{About|Use1||Main Page|and|Main Page}} |
||
:;{{T| |
:;{{T|About|Use1|Use2|Main Page}} →:{{About|Use1|Use2|Main Page}} |
||
:;{{T| |
:;{{T|About|Use1|Use2|Main Page|and|Main Page}} →:{{About|Use1|Use2|Main Page|and|Main Page}} |
||
:;{{T| |
:;{{T|About|Use1|Use2|Main Page|other uses}} →:{{About|Use1|Use2|Main Page|other uses}} |
||
Alternately, a <code>section=yes</code> parameter can be added to the {{T| |
Alternately, a <code>section=yes</code> parameter can be added to the {{T|About}} template for use at the top of a section. When using this parameter, the wording in the template changes to specify that it is being used in a section: |
||
:;{{T| |
:;{{T|About|Use1|<nowiki>section=yes</nowiki>}} →:{{About|Use1|section=yes}} |
||
:;{{T| |
:;{{T|About|Use1|<nowiki/>|Main Page|<nowiki>section=yes</nowiki>}} →:{{About|Use1||Main Page|section=yes}} |
||
:;{{T| |
:;{{T|About|Use1|Use2|Main Page|<nowiki>section=yes</nowiki>}} →:{{About|Use1|Use2|Main Page|section=yes}} |
||
:;{{T| |
:;{{T|About|Use1|Use2|Main Page|and|Main Page|<nowiki>section=yes</nowiki>}} →:{{About|Use1|Use2|Main Page|and|Main Page|section=yes}} |
||
:;{{T| |
:;{{T|About|Use1|Use2|Main Page|other uses|<nowiki>section=yes</nowiki>}} →:{{About|Use1|Use2|Main Page|other uses|section=yes}} |
||
A <var>text</var> option adds text to the end; note that this should be only used when truly necessary, and the other hatnote templates listed below don't suffice. This template also supports <var>selfref</var>. |
A <var>text</var> option adds text to the end; note that this should be only used when truly necessary, and the other hatnote templates listed below don't suffice. This template also supports <var>selfref</var>. |
||
Line 59: | Line 59: | ||
:;If used without parameters on a page named ''Foo'', the result is |
:;If used without parameters on a page named ''Foo'', the result is |
||
::{{ |
::{{hatnote|For other uses, see [[:Foo (disambiguation)]].}} |
||
:;The first parameter changes the hatnote itself and should be plain text, e.g. {{T|For|similar terms}} yields |
:;The first parameter changes the hatnote itself and should be plain text, e.g. {{T|For|similar terms}} yields |
||
::{{ |
::{{hatnote|For similar terms, see [[:Foo (disambiguation)]].}} |
||
:;The second parameter is used to change the resultant link, e.g. {{T|For|similar terms|Main Page}} yields |
:;The second parameter is used to change the resultant link, e.g. {{T|For|similar terms|Main Page}} yields |
||
::{{For|similar terms|Main Page}} |
::{{For|similar terms|Main Page}} |
||
Line 73: | Line 73: | ||
If no hatnote text is supplied, the template will output the following message: |
If no hatnote text is supplied, the template will output the following message: |
||
* {{ |
* {{hatnote|category=no}} |
||
If you see this error message, it is for one of four reasons: |
If you see this error message, it is for one of four reasons: |
||
Line 82: | Line 82: | ||
Pages that contain this error message are tracked in [[:Category:Hatnote templates with errors]]. |
Pages that contain this error message are tracked in [[:Category:Hatnote templates with errors]]. |
||
== Technical details == |
== Technical details == |
||
Line 87: | Line 88: | ||
The HTML code produced by this template looks like this: |
The HTML code produced by this template looks like this: |
||
* <code><nowiki><div role="note" class="hatnote"></nowiki>''hatnote text''<nowiki></div></nowiki></code> |
* <code><nowiki><div role="note" class="hatnote"></nowiki>''hatnote text''<nowiki></div></nowiki></code> |
||
<includeonly>[[Category:Notice templates]]</includeonly> |
<includeonly>[[Category:Notice templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude> |