https://mw.lojban.org/index.php?title=Template:Hatnote/doc&feed=atom&action=historyTemplate:Hatnote/doc - Revision history2024-03-28T15:41:14ZRevision history for this page on the wikiMediaWiki 1.38.4https://mw.lojban.org/index.php?title=Template:Hatnote/doc&diff=97677&oldid=prevGleki: 1 revision2014-06-26T07:47:56Z<p>1 revision</p>
<p><b>New page</b></p><div>{{Documentation subpage}}<br />
{{high-risk|575,000+}}<br />
{{shortcut|T:HAT}}<br />
{{lua|Module:Hatnote}}<br />
<br />
This template formats text into the standard stylistic for a [[Wikipedia:Hatnote|Wikipedia hatnote]]. It produces a short note placed at the top of an article to provide disambiguation of closely related terms or summarise a topic, explaining its boundaries. Hatnotes look like this:<br />
<br />
{{hatnote|Example hatnote text.}}<br />
<br />
{{TOC limit}}<br />
<br />
== Function ==<br />
This template is primarily used to add a correctly formatted ''hatnote'' to a page. Often, but not always, this is a ''disambiguation link'' at the top of article pages. It places an HTML <code>div-</code> / <code>div</code> block around the text entered as its only argument, which provides standardized formatting (contents are indented and italicized in most displays); it also isolates the contained code to make sure that it is interpreted correctly.<br />
<br />
This template is also used as the "meta-template" for additional specialized disambiguation link templates; see [[:Category:Hatnote templates]] for a list.<br />
<br />
The template does not automatically create links of any kind. Links and other desired formatting must be explicitly added, using normal [[Wikipedia:Cheatsheet|Wikipedia markup]].<br />
<br />
== Usage ==<br />
<br />
; Basic usage:<br />
&#123;{hatnote|''text''}}<br />
<br />
; All parameters:<br />
&#123;{hatnote|''text''|extraclasses=''extra classes''|selfref=''yes''|category=''no''}}<br />
<br />
== Parameters ==<br />
<br />
This template accepts the following parameters:<br />
* <code>1</code> - the hatnote text. (required)<br />
* <code>extraclasses</code> - any extra CSS classes to be added. For example, the {{tl|see also}} template adds the classes {{para|extraclasses|boilerplate seealso}}.<br />
* <code>selfref</code> - 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.<br />
* <code>category</code> - 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 hatnote text) is omitted.<br />
<br />
== Example ==<br />
<br />
* <code><nowiki>{{hatnote|Example hatnote text}}</nowiki></code> &rarr; {{hatnote|Example hatnote text}}<br />
<br />
== Errors ==<br />
<br />
If no hatnote text is supplied, the template will output the following message:<br />
* {{hatnote|category=no}}<br />
<br />
If you see this error message, it is for one of four reasons:<br />
# No parameters were specified (the template code was <code><nowiki>{{hatnote}}</nowiki></code>). Please use <code><nowiki>{{hatnote|</nowiki>''text''<nowiki>}}</nowiki></code> instead.<br />
# Some parameters were specified, but the hatnote text wasn't included. For example, the template text <code><nowiki>{{hatnote|extraclasses=seealso}}</nowiki></code> will produce this error. Please use (for example) <code><nowiki>{{hatnote|</nowiki>''text''<nowiki>|extraclasses=seealso}}</nowiki></code> instead.<br />
# The hatnote text was specified, but that text 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 <code><nowiki>{{hatnote|2+2=4}}</nowiki></code> will produce this error. To work around this, you can specify the parameter name explictly by using <code>1=</code> before the hatnote text, like this: <code><nowiki>{{hatnote|1=2+2=4}}</nowiki></code>.<br />
# You tried to access [[Module:Hatnote]] directly by using <code><nowiki>{{#invoke:hatnote|hatnote|</nowiki>''text''<nowiki>}}</nowiki></code>. Use of #invoke in this way has been disabled for performance reasons. Please use <code><nowiki>{{hatnote|</nowiki>''text''<nowiki>}}</nowiki></code> instead.<br />
<br />
If you see this error message and are unsure of what to do, please post a message on [[Template talk:Hatnote]], and someone should be able to help you.<br />
<br />
Pages that contain this error message are tracked in [[:Category:Hatnote templates with errors]].<br />
<br />
== Technical details ==<br />
<br />
The HTML code produced by this template looks like this:<br />
<br />
* <code><nowiki><div class="hatnote"></nowiki>''hatnote text''<nowiki></div></nowiki></code><br />
<br />
The code is produced by [[Module:Hatnote]].<br />
<br />
{{Hatnote templates documentation}}<br />
{{Collapse top|TemplateData}}<br />
{{TemplateDataHeader}}<br />
<templatedata><br />
{<br />
"description": "Template for creating a standard Wikipedia hatnote. A hatnote is a short note placed at the top of an article to provide disambiguation of closely related terms or summarise a topic, explaining its boundaries.",<br />
"params": {<br />
"1": {<br />
"label": "Text",<br />
"description": "This field should contain the text that will be displayed in the hatnote.",<br />
"type": "string",<br />
"required": true<br />
},<br />
"extraclasses": {<br />
"type": "string/line",<br />
"label": "Extra classes",<br />
"description": "Extra CSS classes to be added to the <div> tags surrounding the hatnote text."<br />
},<br />
"selfref": {<br />
"type": "string/line",<br />
"label": "Self reference",<br />
"description": "Set to \"yes\" if the hatnote text is a self-reference to Wikipedia that would not make sense on mirrors or forks of the Wikipedia site. (E.g. \"For the Wikipedia Sandbox, see [[WP:SAND]]\".)"<br />
},<br />
"category": {<br />
"label": "Category",<br />
"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 the hatnote text is omitted."<br />
}<br />
}<br />
}<br />
</templatedata><br />
{{Collapse bottom}}<br />
<br />
<includeonly><br />
[[Category:Hatnote templates]]<br />
</includeonly></div>Gleki