Template:Hatnote inline/doc
This is a documentation subpage for Template:Hatnote inline. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
This documentation is in transition. It presently documents both the meta-template and the cross-reference templates that will be derived from it in the next development round. If you intend to use the meta-template to develop specific templates, use {{hatnote-inline}} . If you intend to use the template inline right now in articles or other pages, use {{xref}} or {{crossref}} . |
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:
Function
This template is primarily used to add a correctly formatted inline cross-reference 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.}}
→
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-inline.
Redirects
See also
Templates based on this meta-template
{{Ghat}}
- Hatnote template for use in template-structured glossaries