Template:Ref: Difference between revisions
(added support back in for alpha refs) |
(oops, forgot that sometimes this template will be passed only a ref name and no body text) |
||
Line 4: | Line 4: | ||
#ifeq:{{{alpha}}} | #ifeq:{{{alpha}}} | ||
|yes | |yes | ||
|{{#tag:ref|{{{1}}}|name={{{name}}}|group=lower-alpha}} | |{{#tag:ref|{{{1|}}}|name={{{name}}}|group=lower-alpha}} | ||
|{{ | |{{ | ||
#if:{{{group|}}} | #if:{{{group|}}} | ||
|{{#tag:ref|{{{1}}}|name={{{name}}}|group={{{group}}}}} | |{{#tag:ref|{{{1|}}}|name={{{name}}}|group={{{group}}}}} | ||
|{{#tag:ref|{{{1}}}|name={{{name}}}}} | |{{#tag:ref|{{{1|}}}|name={{{name}}}}} | ||
}} | }} | ||
}} | }} | ||
Line 14: | Line 14: | ||
#ifeq:{{{alpha}}} | #ifeq:{{{alpha}}} | ||
|yes | |yes | ||
|{{#tag:ref|{{{1}}}|group=lower-alpha}} | |{{#tag:ref|{{{1|}}}|group=lower-alpha}} | ||
|{{ | |{{ | ||
#if:{{{group|}}} | #if:{{{group|}}} | ||
|{{#tag:ref|{{{1}}}|group={{{group}}}}} | |{{#tag:ref|{{{1|}}}|group={{{group}}}}} | ||
|{{#tag:ref|{{{1}}}}} | |{{#tag:ref|{{{1|}}}}} | ||
}} | }} | ||
}} | }} |
Revision as of 04:35, 24 April 2025
A shortcut for creating a reference in an article. Call this with the syntax {{ref|Text of your reference.}} to place a ref in an article, and then list the references at the end of the article using Template:Reflist. If the text that you pass in contains a '=' or '|' (pipe), you need to escape them because they have special meanings in template calls. The equals sign is escaped with the use of {{=}} and the pipe with {{!}}.
If you want to only list ref tags in a certain group, use the "group" parameter: {{ref|group=group_name|Text of your reference.}}. See Oni for an example usage.
If you want your references to use letters instead of numbers, use {{ref|alpha=yes|Text of your reference.}}.