Template:Refn/doc
{{#ifeq:doc |doc
|
{{#ifeq:show |show
|
40px | This is a documentation subpage for Template:Terminate sentence It contains usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if: | | {{#ifexist:Template:Refn | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | }} }} | }}
Purpose[edit source]
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:
- <syntaxhighlight lang="HTML" inline>[2]</syntaxhighlight> (Generates: [[Help:Footnotes|]] instead of a wikilink)
- <syntaxhighlight lang="HTML" inline>[3]</syntaxhighlight> (Generates: {{SUBST:TODAY}} instead of the date that the edit was made)
- <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 {{Refn}} allows for the use of the markup elements listed above.
Usage[edit source]
{{refn|group=groupname|name=name|Contents of the footnote}}
- 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
Names for footnotes and groups must follow these rules:
- Names are case-sensitive. Please do not use raNdOM capitalization.
- Names must not be purely numeric; the software will accept something like
":31337"
(which is punctuation plus a number), but it will ignore"31337"
(purely numeric). - Names should have semantic value, so that they can be more easily distinguished from each other by human editors who are looking at the wikitext. This means that ref names like
"Nguyen 2010"
are preferred to names like":31337"
. - Names must be unique. You may not use the same name to define different groups or footnotes. Try to avoid picking a name that someone else is likely to choose for a new citation, such as
":0"
or"NYT"
. - Please consider keeping reference names simple and restricted to the standard English alphabet and numerals. If spaces are used, the following technical restrictions become relevant:
- Quotation marks are preferred but optional if the only characters used are letters
A–Z
,a–z
, digits0–9
, and the symbols!$%&()*,-.:;<@[]^_`{|}~
. That is, all printable ASCII characters except#"'/=>?\
. - Inclusion of any other characters, including spaces, requires that the reference name be enclosed in quotes; for example,
name="John Smith"
. - The quote marks must be the standard, straight, double quotation marks (
"
); curly or other quotes will be parsed as part of the reference name. - Quote-enclosed reference names may not include a less-than sign (
<
) or a double straight quote symbol ("
). These may be escaped with<
and"
, respectively.{{#if: |
- Quotation marks are preferred but optional if the only characters used are letters
{{{2}}}}}
- You may optionally provide reference names even when the reference name is not required. This makes later re-use of the sourced reference easier.
Examples[edit source]
Footnotes with citations[edit source]
{{#if: ||+ {{{title}}}}} {{#if: |Markup | Renders as
}}{{#if:An example.{{#if:first|[note 1]|[note 2]}}
Another example.{{#if:|[note 3]|[note 4]}}
A third example.{{#if:|[note 5]|[note 6]}}
Repeating the first example.{{#if:first|[note 1]|Cite error: Invalid {{#switch: {{#if: |
{{{demospace}}} | main | other
}} }} |
main = Template:Error | other | #default = }} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: {{{1}}};}} | column-width: {{{colwidth}}};}}
}} {{#if:note||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> {{#switch: {{#if: |
{{{demospace}}} | main | other
}} }} |
main = Template:Error | other | #default = }} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: {{{1}}};}} | column-width: {{{colwidth}}};}}
}} {{#if:||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}>| | ||
An example.{{#if:first|[note 1]|[note 2]}} Another example.{{#if:|[note 3]|[note 4]}} A third example.{{#if:|[note 5]|[note 6]}} Repeating the first example.{{#if:first|[note 1]|Cite error: Invalid |
}}{{#if:| | ||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}} | |||||||||||||||||||
Other forms of citations[edit source]
{{#if: ||+ {{{title}}}}} {{#if: |Markup | Renders as
}}{{#if:An example.{{#if:first|[note 1]|[note 2]}}
Another example.{{#if:ref|[2]|[3]}}
A third example.{{#if:|[note 3]|[note 4]}}
Repeating the first example.{{#if:first|[note 1]|Cite error: Invalid {{#switch: {{#if: |
{{{demospace}}} | main | other
}} }} |
main = Template:Error | other | #default = }} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: {{{1}}};}} | column-width: {{{colwidth}}};}}
}} {{#if:note||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> {{#switch: {{#if: |
{{{demospace}}} | main | other
}} }} |
main = Template:Error | other | #default = }} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: {{{1}}};}} | column-width: {{{colwidth}}};}}
}} {{#if:||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}>
| ||
An example.{{#if:first|[note 1]|[note 2]}} Another example.{{#if:ref|[2]|[3]}} A third example.{{#if:|[note 3]|[note 4]}} Repeating the first example.{{#if:first|[note 1]|Cite error: Invalid |
}}{{#if:| | ||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}}{{#if:| | |||||||||||||||||||
}} | |||||||||||||||||||
Substitution[edit source]
The first example shows that substitution does not work in a regular <syntaxhighlight lang="HTML" inline>[1]</syntaxhighlight> tag (the |{{SAFESUBST:#if:access-date|access-date=}}
does not appear correctly). The second example shows that the |{{SAFESUBST:#if:access-date|access-date=}}
is substituted correctly within {{refn}}.
Markup | Renders as
}}{{#if:[2] 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: {{{1}}};}} | column-width: {{{colwidth}}};}}
}} {{#if:||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}>
|
[2] <div class="reflist {{#if:|reflist-columns references-column-width}} {{#switch:|upper-alpha|upper-roman|lower-alpha|lower-greek|lower-roman=reflist-{{{group}}}}} {{#if:|{{#iferror:{{#ifexpr: 1 > 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if: | {{#iferror: {{#ifexpr: 1 > 1 }} |column-width: {{{1}}};}} | {{#if: |column-width: {{{colwidth}}};}} }} {{#if:||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> |
{{refn|{{cite web |access-date={{Subst:TODAY}} |title=Languages |work=Apache HTTP Server |agency=Ohloh |publisher= Black Duck Software |url=https://www.ohloh.net/p/apache/analyses/latest/languages_summary}}}} {{reflist}} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: {{{1}}};}} | column-width: {{{colwidth}}};}}
}} {{#if:||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}>
|
{{#if:|[1]|[2]}} <div class="reflist {{#if:|reflist-columns references-column-width}} {{#switch:|upper-alpha|upper-roman|lower-alpha|lower-greek|lower-roman=reflist-{{{group}}}}} {{#if:|{{#iferror:{{#ifexpr: 1 > 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if: | {{#iferror: {{#ifexpr: 1 > 1 }} |column-width: {{{1}}};}} | {{#if: |column-width: {{{colwidth}}};}} }} {{#if:||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> |
}}{{#if:| | ||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}} | |||
Errors[edit source]
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:
Markup | Renders as
}}{{#if:{{refn|1+1=2}}| | ||
{{refn|1+1=2}} |
Cite error: There are <ref> tags on this page without content in them (see the help page). }}{{#if:{{refn|1= 1+1=2}}| | ||
{{refn|1= 1+1=2}} |
column-width: {{{1}}};}} | column-width: {{{colwidth}}};}}
}} {{#if:||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> }}{{#if:| | |
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}}{{#if:| | |||
}} | |||
There are several predefined groups that can have a reference list styled so that the label (a superscripted character within square brackets, e.g., [{{#ifeq:{{safesubst:#switch:
|no |n |f |false |off |0 = | = |¬ = |yes |y |t |true |on |1 = yes |#default = yes
}}|yes|}}{{#if:|}}1{{#if:|}}{{#ifeq:{{safesubst:#switch:
|no |n |f |false |off |0 = | = |¬ = |yes |y |t |true |on |1 = yes |#default = yes
}}|yes|}}]) of an explanatory note or citation (aka footnote, reference) matches and links to the note marker label located in the main text and the label in front of the note's text in the appropriate group's list. There can be more than one of these groups' lists in the Notes, References and other similarly purposed sections.
These predefined note and citation groups have templates that make the wikitext markup simpler. These templates also allow a standard reference to be inserted, so that an explanatory note can have a reference, or citations can be nested.
Note: If the note's text has a reference name that is used more than once, the labels will still match, but the clickable alpha characters that toggle the note's display will be next to the note's label, with links to the multiple locations of its marker in the main text. See WP:REFNAME and the first point below in § Issues.
Template use by reference group type[edit source]
Group type | Footnote marker template or markup |
Reference list template |
Sample labels | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
none by default, but optionally any | {{#switch:pair
|
close = | empty|s|single|v|void | open | pair = <{{#if:|ref|ref}}{{#if:| {{{attribs}}}}}
}}{{#switch:pair |
close = | empty|s|single|v|void = /> | open = > | pair = {{#ifeq:ref|!-- | >}}...
}}{{#switch:pair |
empty|s|single|v|void | open = | close | pair = {{#ifeq:ref|!--|-->|</ref>}}
}} |
{{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:reflist|reflist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | 1 2 3 4 5 6 7 8 9 10 |
{{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:r|r]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} (for nested references) | ||||||||||||||||
{{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:refn|refn]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} (for nested references) | ||||||||||||||||
lower-alpha | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn|efn]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} {{#if: |
}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn-la|efn-la]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:notelist|notelist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} {{#if: |
}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:notelist-la|notelist-la]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | a b c d e f g h i j | |||||||
upper-alpha | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn-ua|efn-ua]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:notelist-ua|notelist-ua]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | A B C D E F G H I J | |||||||||||
lower-roman | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn-lr|efn-lr]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:notelist-lr|notelist-lr]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | i ii iii iv v vi vii viii ix x | |||||||||||
upper-roman | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn-ur|efn-ur]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:notelist-ur|notelist-ur]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | I II III IV V VI VII VIII IX X | |||||||||||
lower-greek | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn-lg|efn-lg]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:notelist-lg|notelist-lg]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | α β γ δ ε ζ η θ ι κ | |||||||||||
note | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:NoteTag|NoteTag]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | {{#if: | }}{{[[{{#if:|{{{SISTER}}}Template|Template}}:NoteFoot|NoteFoot]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if: |
}} | note 1 note 2 note 3 |
- {{#if:||
}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn|efn]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} supports|{{SAFESUBST:#if:name|name=}}
and|{{SAFESUBST:#if:group|group=}}
, which work the same as the parameters in{{#switch:o
|c|close =
|e|empty|s|single|v|void
|o|open
|p|pair = <{{#if:|ref|ref}}{{#if:| {{{attribs}}}}}
}}{{#switch:o
|c|close =
|e|empty|s|single|v|void = />
|o|open = >
|p|pair = {{#ifeq:ref|!--||>}}...
}}{{#switch:o
|e|empty|s|single|v|void
|o|open =
|c|close
|p|pair = {{#ifeq:ref|!--|-->|</ref>}}
}}
(see, for instance, the 3rd and 4th examples below). Do not enclose values in quotes.
- {{#if:||
}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:notelist|notelist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} supports the|{{SAFESUBST:#if:colwidth|colwidth=}}
,|{{SAFESUBST:#if:refs|refs=}}
, and|{{SAFESUBST:#if:group|group=}}
parameters, which work the same as the parameters in {{#if:||}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:reflist|reflist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}}. Do not enclose values in quotes.
In these examples, the footnote labels match between the footnote marker and the reference list:
{{#if:With lower-alpha labels ||+ With lower-alpha labels}} {{#if: |Markup | Renders as
}}{{#if:Lorem ipsum dolor sit amet.{{efn|Footnote 1}} Consectetur adipisicing elit.{{efn|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn|Footnote 3}} {{notelist}} | | |||||||||||||||
Lorem ipsum dolor sit amet.{{efn|Footnote 1}} Consectetur adipisicing elit.{{efn|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn|Footnote 3}} {{notelist}} |
Lorem ipsum dolor sit amet.{{#if: |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 1] | [{{#switch:
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman =
| #default = lower-alpha
}} 2]
}} Consectetur adipisicing elit.{{#if: |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 3] | [{{#switch:
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman =
| #default = lower-alpha
}} 4]
}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{#if: |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 5] | [{{#switch:
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman =
| #default = lower-alpha
}} 6]
}} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: ;}} | column-width: {{{colwidth}}};}}
}} {{#if:{{#switch: |
note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha
}}||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> }}{{#if:| |
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}} | ||||||||||||||||
Markup | Renders as
}}{{#if:Lorem ipsum dolor sit amet.{{efn-lr|Footnote 1}} Consectetur adipisicing elit.{{efn-lr|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn-lr|Footnote 3}} {{notelist-lr}} | | |||||||||||||||
Lorem ipsum dolor sit amet.{{efn-lr|Footnote 1}} Consectetur adipisicing elit.{{efn-lr|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn-lr|Footnote 3}} {{notelist-lr}} |
Lorem ipsum dolor sit amet.{{#if: |
[{{#switch: lower-roman | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = lower-roman | #default = lower-alpha }} 1] | [{{#switch: lower-roman
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = lower-roman
| #default = lower-alpha
}} 2]
}} Consectetur adipisicing elit.{{#if: |
[{{#switch: lower-roman | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = lower-roman | #default = lower-alpha }} 3] | [{{#switch: lower-roman
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = lower-roman
| #default = lower-alpha
}} 4]
}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{#if: |
[{{#switch: lower-roman | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = lower-roman | #default = lower-alpha }} 5] | [{{#switch: lower-roman
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = lower-roman
| #default = lower-alpha
}} 6]
}} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: ;}} | column-width: {{{colwidth}}};}}
}} {{#if:{{#switch: lower-roman |
note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = lower-roman | #default = lower-alpha
}}||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> }}{{#if:| |
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}} | ||||||||||||||||
Markup | Renders as
}}{{#if:Lorem ipsum dolor sit amet.{{efn|name=fn1|Footnote 1}} Consectetur adipisicing elit.{{efn|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn|name=fn1}} {{notelist}} | | |||||||||||||||
Lorem ipsum dolor sit amet.{{efn|name=fn1|Footnote 1}} Consectetur adipisicing elit.{{efn|Footnote 2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn|name=fn1}} {{notelist}} |
Lorem ipsum dolor sit amet.{{#if:fn1 |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 1] | [{{#switch:
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman =
| #default = lower-alpha
}} 2]
}} Consectetur adipisicing elit.{{#if: |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 3] | [{{#switch:
| note
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman =
| #default = lower-alpha
}} 4]
}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{#if:fn1 |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 1] | Cite error: Invalid <ref> tag; refs with no name must have content
}} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: ;}} | column-width: {{{colwidth}}};}}
}} {{#if:{{#switch: |
note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha
}}||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> }}{{#if:| |
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}} | ||||||||||||||||
Markup | Renders as
}}{{#if:Lorem ipsum dolor sit amet.{{efn|name=fn1}} Consectetur adipisicing elit.{{efn|name=fn2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn|name=fn1}} {{notelist|refs= {{efn|name=fn1|Very long footnote 1}} {{efn|name=fn2|Very long footnote 2}} }} | | |||||||||||||||
Lorem ipsum dolor sit amet.{{efn|name=fn1}} Consectetur adipisicing elit.{{efn|name=fn2}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{efn|name=fn1}} {{notelist|refs= {{efn|name=fn1|Very long footnote 1}} {{efn|name=fn2|Very long footnote 2}} }} |
Lorem ipsum dolor sit amet.{{#if:fn1 |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 1] | Cite error: Invalid <ref> tag; refs with no name must have content
}} Consectetur adipisicing elit.{{#if:fn2 |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 2] | Cite error: Invalid <ref> tag; refs with no name must have content
}} Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{{#if:fn1 |
[{{#switch: | note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha }} 1] | Cite error: Invalid <ref> tag; refs with no name must have content
}} 1 }}||{{#switch:|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" {{#if:|style="{{#if:
|
column-width: ;}} | column-width: {{{colwidth}}};}}
}} {{#if:{{#switch: |
note | upper-alpha | upper-roman | lower-alpha | lower-greek | lower-roman = | #default = lower-alpha
}}||{{#if:|list-style-type: {{{liststyle}}};}}}}"}}> Cite error: <ref> tag defined in <references> has no name attribute.
}}{{#if:| |
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}}{{#if:| | ||||||||||||||||
}} | ||||||||||||||||
Issues[edit source]
- Multiple backlink labels (see WP:REFNAME) are always styled as lower-alpha. This can be confusing when {{#if:||
}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn|efn]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} is used. See the note in the introduction of this section, above. - The entries in the reference list will show the default decimal styling if:
- The value for
|{{SAFESUBST:#if:group|group=}}
in {{#if:||}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:reflist|reflist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} or{{#switch:s
- The value for
|c|close = |e|empty|s|single|v|void |o|open |p|pair = <{{#if:|references|references}}{{#if:| {{{attribs}}}}} }}{{#switch:s |c|close = |e|empty|s|single|v|void = /> |o|open = > |p|pair = {{#ifeq:references|!--||>}}... }}{{#switch:s |e|empty|s|single|v|void |o|open = |c|close |p|pair = {{#ifeq:references|!--|-->|</references>}} }}
does not exactly match one of the predefined values; use {{#if:||}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn|efn]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} or variant as|{{SAFESUBST:#if:group|group=}}
will not be needed.
- The value for
|{{SAFESUBST:#if:group|group=}}
in {{#if:||}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:reflist|reflist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} or{{#switch:s
- The value for
|c|close = |e|empty|s|single|v|void |o|open |p|pair = <{{#if:|references|references}}{{#if:| {{{attribs}}}}} }}{{#switch:s |c|close = |e|empty|s|single|v|void = /> |o|open = > |p|pair = {{#ifeq:references|!--||>}}... }}{{#switch:s |e|empty|s|single|v|void |o|open = |c|close |p|pair = {{#ifeq:references|!--|-->|</references>}} }}
is enclosed by quotes; use {{#if:||}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:efn|efn]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} or variant as|{{SAFESUBST:#if:group|group=}}
will not be needed.
- {{#if:||
}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:reflist|reflist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} is indented with the <syntaxhighlight lang="text" class="" id="" style="" inline="1">:</syntaxhighlight> markup. {{#switch:s
- {{#if:||
|c|close = |e|empty|s|single|v|void |o|open |p|pair = <{{#if:|references|references}}{{#if:| {{{attribs}}}}} }}{{#switch:s |c|close = |e|empty|s|single|v|void = /> |o|open = > |p|pair = {{#ifeq:references|!--||>}}... }}{{#switch:s |e|empty|s|single|v|void |o|open = |c|close |p|pair = {{#ifeq:references|!--|-->|</references>}} }}
is used instead of {{#if:||}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:reflist|reflist]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}}
- The entries in the reference list will have no styling if:
- A reference is included in {{#if:||
}}{{[[{{#if:|{{{SISTER}}}Template|Template}}:navbox|navbox]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}{{#if:||
}} or one of the variants and the style is set tobodyclass=hlist
; to resolve this, replace the style withlistclass=hlist
.
- A reference is included in {{#if:||
See also[edit source]
- {{r}} (another template supporting nested footnotes)
- {{citeref}} (a different method to create nested links working on citation template anchor level rather than <ref></ref> markup level)
TemplateData[edit source]
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CRefn%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CRefn%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CRefn%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:Refn}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|#default=[1]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CRefn%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CRefn%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CRefn%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:Refn}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|#default=[2]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}} }}}}
TemplateData for Refn
{{#switch:
{{#if: | {{{demospace}}} | {{#ifeq:Template|Template | template | other }} }}
| template = {{#if:{{#ifeq:doc|sandbox|1}}{{#ifeq:doc|doc|1}}||
}} | other | #default = }} <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>