Jump to content

Template:Hatnote inline/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
brevity
rm inapplicable section
Line 36: Line 36:


* <code><nowiki>{{hatnote-inline|See [[Taxonomic nomenclature]] for more detail.}}</nowiki></code> &rarr; {{hatnote-inline|See [[Taxonomic nomenclature]] for more detail.}}
* <code><nowiki>{{hatnote-inline|See [[Taxonomic nomenclature]] for more detail.}}</nowiki></code> &rarr; {{hatnote-inline|See [[Taxonomic nomenclature]] for more detail.}}

== Errors ==

If no cross-reference text is supplied, the template will output the following message:
* {{hatnote-inline|category=no}}

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

Revision as of 10:24, 19 May 2014

This meta-template formats text into the standard style for an inline (not block-level) Wikipedia:Hatnote variant. The two most common uses for this are for inline "(See also ...)" inline Wikipedia cross-references, provided by the {{crossref}} template, and hatnotes (also generally cross-references) inside definitions in template-formatted glossaries, provided by the {{ghat}} template.

{{Hatnote-inline}} 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 inline 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 other 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 uses CSS classes to isolate the contained code to make sure that it is interpreted correctly and can be acted upon independently of true article content.

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=class1 class2|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.

Technical details

The HTML code produced by this template looks like this:

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

This is the same class used by the <div>-based {{hatnote}} template, the block display of which is controlled by a separate div.hatnote directive in Mediawiki:Common.css.

The code is produced by Module:Hatnote/sandbox-inline.

Redirects

See also