Template:Refn
Purpose
This template is used to create footnotes in Wikipedia, as an alternative and complement to the <syntaxhighlight lang="HTML" inline><ref></syntaxhighlight>. Because of a technical limitation, some of the standard Wikipedia markup elements that are often used in the article prose do not work within a set of <syntaxhighlight lang="HTML" inline>[1]</syntaxhighlight> tags, including but not limited to the pipe trick, template substitution and another "nested" set of <syntaxhighlight lang="HTML" inline>[2]</syntaxhighlight> tags. For example, the following does not work as expected:
- <syntaxhighlight lang="HTML" inline>[3]</syntaxhighlight> (Generates: [[Help:Footnotes|]] instead of a wikilink)
- <syntaxhighlight lang="HTML" inline>[4]</syntaxhighlight> (Generates: {{SUBST:TODAY}} instead of the date that the edit was made)
- <syntaxhighlight lang="HTML" inline><ref>Explanatory footnote<ref>Citation</ref></ref></syntaxhighlight> (Generates: Cite error: A <ref> tag is missing the closing </ref> (see the help page). </ref>)
Replacing the outermost <syntaxhighlight lang="HTML" inline>[5]</syntaxhighlight> set with Template:Tlp allows for the use of the markup elements listed above.
Usage
- groupname: Groupname per WP:REFGROUP; if not specified, then the main and nested references will be rendered into the same reference list
- name: Reference name per WP:REFNAME
Examples
Footnotes with citations
Substitution
The first example shows that substitution does not work in a regular <syntaxhighlight lang="HTML" inline>[6]</syntaxhighlight> tag (the |access-date=
does not appear correctly). The second example shows that the |access-date=
is substituted correctly within {{refn}}.
Errors
If the reference or note content is missing, then Cite error: Invalid <ref> tag; refs with no name must have content. will be displayed.
If the note content contains an equals sign (=
), the equals sign will be interpreted as setting off a named parameter and cause an error. This can be worked around by using a numbered parameter, for example:
See also
Help:Cite errors/Cite error group refs without references
Template:Wikipedia referencing
TemplateData
Template:TemplateData header <templatedata> { "params": { "1": { "label": "content", "description": "The content of the footnote.", "type": "content", "required": true, "suggested": true, "aliases": [ "refn" ] }, "name": { "description": "The name of the footnote. Corresponds to the \"name\" attribute of the <ref> tag.", "type": "string" }, "group": { "label": "group", "description": "The reference group. Corresponds to the \"group\" attribute on the <ref> tag.", "type": "string" } }, "description": "This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref> tag.", "paramOrder": [ "1", "name", "group" ], "format": "inline" } </templatedata>
The above documentation is transcluded from Template:Refn/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |