Template:Ref: Difference between revisions
(fixed group and name parameters) |
(rewrote logic in order to *really* fix group and name parameters) |
||
Line 1: | Line 1: | ||
<includeonly>{{ | <includeonly>{{ | ||
#if:{{{name|}}} | |||
|{{ | |||
#if:{{{group|}}} | |||
|{{#tag:ref|{{{1}}}|name={{{name}}}|group={{{group}}}}} | |||
|{{#tag:ref|{{{1}}}|name={{{name}}}}} | |||
}} | |||
|{{ | |||
#if:{{{group|}}} | |||
|{{#tag:ref|{{{1}}}|group={{{group}}}}} | |||
|{{#tag:ref|{{{1}}}}} | |||
}} | |||
}}</includeonly><noinclude> | |||
A shortcut for creating a reference in an article. Call this with the syntax <tt><nowiki>{{ref|Text of your reference.}}</nowiki></tt> 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 <tt><nowiki>{{=}}</nowiki></tt> and the pipe with <tt><nowiki>{{!}}</nowiki></tt>. | A shortcut for creating a reference in an article. Call this with the syntax <tt><nowiki>{{ref|Text of your reference.}}</nowiki></tt> 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 <tt><nowiki>{{=}}</nowiki></tt> and the pipe with <tt><nowiki>{{!}}</nowiki></tt>. | ||
Revision as of 04:47, 23 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.}}.