Template:Hatnote-inline
This template uses Lua: |
This is a meta-template for development of additional, more specific templates. If you intend to use the template inline in articles or other pages, use {{crossreference}} (shortcuts: or {{crossref}} and {{xref}} ). |
The most common uses for this meta-template are:
- Inline "(See also ...)"-type parenthetical Wikipedia crossreferences to other Wikipedia pages, provided by the
{{crossreference}}
template and its progeny. These are unprintworthy Wikipedia self-references. - Hatnotes inside definitions in template-formatted glossaries, provided by the
{{ghat}}
template. These are printworthy, as they refer to content on the same page.
Usage
- Basic usage
{{hatnote-inline|text}}
- All parameters
{{hatnote-inline|text|extraclasses=class1 class2|selfref=yes|category=no}}
The meta-template does not automatically create links of any kind. Links and other desired formatting must be explicitly added, using normal Wikipedia markup.
Parameters
This template accepts the following parameters:
1
– the cross-reference text. (required)class
orextraclasses
– any extra CSS classes to be added. For example, the {{see also}} template adds the classes|class=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. It is set to selfref by default, since most uses are self-references (only those within the same article as the template are not).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. This should not normally be used.
Technical details
The meta-template 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, and only stylistically, not as semantic emphasis); 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 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 output is produced by Module:Hatnote-inline.
See also
- Template:Hatnote templates documentation, for all the block-format hatnotes
Templates based on this meta-template
- {{Crossreference}} (a.k.a. {{Crossref}}, {{Xref}}) – Template for inline crossreferences to (usually) other Wikipedia pages (unprintworthy in most cases)
- {{Ghat}} – Hatnote template for use in template-structured glossaries (printworthy)
- {{See above}} and {{See below}} – some more specific templates than {{Crossreference}} for use on same page only (printworthy)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.