Template:Refn/doc

From MicrasWiki
< Template:Refn
Revision as of 03:02, 21 March 2019 by Hālian (talk | contribs) (Created page with "{{Documentation subpage}} ===Purpose=== This template is used to create footnotes in Wikipedia, as an alternative and complement to the <syntaxhighlight lan...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Purpose

This template is used to create footnotes in Wikipedia, as an alternative and complement to the <syntaxhighlight lang="HTML" inline>Cite error: Closing </ref> missing for <ref> tag</syntaxhighlight> tags, including but not limited to the pipe trick, template substitution and another "nested" set of <syntaxhighlight lang="HTML" inline>[1]</syntaxhighlight> tags. For example, the following does not work as expected:

  1. <syntaxhighlight lang="HTML" inline>[2]</syntaxhighlight> (Generates: [[Help:Footnotes|]] instead of a wikilink)
  2. <syntaxhighlight lang="HTML" inline>[3]</syntaxhighlight> (Generates: {{SUBST:TODAY}} instead of the date that the edit was made)
  3. <syntaxhighlight lang="HTML" inline>Cite error: Closing </ref> missing for <ref> tag</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>[4]</syntaxhighlight> set with Template:Tlp allows for the use of the markup elements listed above.

Usage

Template:Tld

  • 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

Template:Refname rules

Examples

Footnotes with citations

Template:Markup

Substitution

The first example shows that substitution does not work in a regular <syntaxhighlight lang="HTML" inline>[5]</syntaxhighlight> tag (the |access-date= does not appear correctly). The second example shows that the |access-date= is substituted correctly within {{refn}}.

Template:Markup

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:

Template:Markup


Help:Footnotes

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>

  1. ^ ...
  2. ^ [[Help:Footnotes|]]
  3. ^ {{SUBST:TODAY}}
  4. ^ ...
  5. ^ ...