Jump to content

Template:Hatnote inline/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Hatnote templates: collapsing irrelevant docs
Redirds
Line 58: Line 58:


The code is produced by [[Module:Hatnote-inline]].
The code is produced by [[Module:Hatnote-inline]].

==Redirects==

* {{Tlx|crossref}}
* {{tlx|xref}}


{{collapse top|title=Documentation for indented block hatnote templates}}
{{collapse top|title=Documentation for indented block hatnote templates}}

Revision as of 16:12, 18 May 2014

This template formats text into the standard style for an inline Wikipedia cross-reference ("inline hatnote"). It produces a short note placed at the point of insertion, to link to more information or otherwise cross-reference another Wikipedia page. Inline cross-references look like this:

Example hatnote text.

Function

This template is primarily used to add a correctly formatted inline cross-references to a page. Often, but not always, this is a see otehr page link in a parenthetical. It places an HTML <span>...</span> container around the text entered as its first, required parameter, upon which it provides standardized formatting (italicized in most displays); it also isolates the contained code to make sure that it is interpreted correctly.

This template cans also be used as the "meta-template" for additional specialized disambiguation link templates; see Category:Cross-reference templates for a list.

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

Usage

Basic usage
{{hatnote-inline|text}}
All parameters
{{hatnote-inline|text|extraclasses=extra classes|selfref=yes|category=no}}

Parameters

This template accepts the following parameters:

  • 1 - the cross-reference text. (required)
  • extraclasses - any extra CSS classes to be added. For example, the {{see also}} template adds the classes |extraclasses=boilerplate seealso.
  • 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 hatnote text) is omitted.

Example

  • {{hatnote-inline|See [[Taxonomic nomenclature]] for more detail}}See Taxonomic nomenclature for more detail

Errors

If no cross-reference text is supplied, the template will output the following message:

  • {{{content}}}

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

  1. No parameters were specified (the template code was {{hatnote-inline}}). Please use {{hatnote-inline|text}} instead.
  2. Some parameters were specified, but the cross-reference text wasn't included. For example, the template text {{hatnote-inline|extraclasses=seealso}} will produce this error. Please use (for example) {{hatnote-inline|text|extraclasses=seealso}} instead.
  3. The cross-reference 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 {{hatnote-inline|See [[E=MC²]] for more information}} will produce this error. To work around this, you can specify the parameter name explictly by using |1= before the cross-reference text, like this: {{hatnote-inline|1=See [[E=MC²]] for more information}}.
  4. You tried to access Module:Hatnote-inline directly by using {{#invoke:hatnote-inline|hatnote-inline|text}}. Use of #invoke in this way has been disabled for performance reasons. Please use {{hatnote-inline|text}} instead.

If you see this error message and are unsure of what to do, please post a message on Template talk:Hatnote-inline, and someone should be able to help you.

Pages that contain this error message are tracked in Category:Hatnote templates with errors.

Technical details

The HTML code produced by this template looks like this:

  • <span class="hatnote-inline">hatnote text</span>

The code is produced by Module:Hatnote-inline.

Redirects

Documentation for indented block hatnote templates