Template:Hatnote/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (Remove Sandbox other template)
m (Remove Sandbox other template)
(No difference)

Latest revision as of 08:15, 2 September 2022

This template produces formatted text in a manner consistent with the guidelines for a hatnote, as described in the Wikipedia Manual of Style. In its basic form, it is invoked like this:

{{Hatnote|Use at the tops of pages and directly under section headers to preemptively answer a reader's questions before they continue onto the text below.}} (↓ Output below. ↓)

Use at the tops of pages and directly under section headers to preemptively answer a reader's questions before they continue onto the text below.


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 HTML <div>...</div> tags around the text entered as its only unnamed parameter, which applies standardized formatting suitable to these use cases (contents are indented off the left page margin and italicized); it also isolates the contained code to make sure that it is interpreted correctly.

The template does not automatically create links of any kind. Links and other desired formatting must be explicitly added, using normal wikitext markup.


Basic syntax

{{Hatnote|Example text}}

Full syntax

{{Hatnote|text=Example text|class=extra classes|style=extra inline CSS styles}}


This template accepts the following parameters:

  • |1=} or |text= – The hatnote text (required)
  • |class= – Any extra CSS classes to be added, for example, the {{See also}} template adds the classes |class=boilerplate seealso.
  • |style= – Any extra inline CSS definitions you wish to be assigned to the <div>...</div> tags. This is often used to perform additional manipulations to the hatnote text, such as changing its size or color.


( which outputs )
Example hatnote text


If no hatnote text is supplied, the template will output the following message:

  • Error: No input supplied by user,

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

  1. No parameters were specified (the template code was simply "{{Hatnote}}"; you must supply text for it to display.
  2. Some parameters were specified, but the hatnote text wasn't included. For example, {{Hatnote}} will produce this error. Again, you must give it some text to display as an unnamed parameter.
  3. The hatnote text was specified, but that text contains an equality sign (=). The equality 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 {{Hatnote|2+2=4}} will produce this error. To work around this, you can specify the alias for the unnamed parameter, which in this case is |text=, and place your hatnote text there. Your invocation would then look like this: {{Hatnote|text=2+2=4}}

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.

Technical details

The HTML code produced by this template looks like this:

  • <div class="hatnote" style="font-style: italic; margin-left: 1.6em;">Hatnote text</div>