20,283
edits
m (docs: elaborated a little more) |
(if we name the main parameter of the template then it should prevent the need to enclose '=' and '|' in double curly braces; this will prevent arcane errors when we forget to do that) |
||
| Line 4: | Line 4: | ||
#ifeq:{{{alpha}}} | #ifeq:{{{alpha}}} | ||
|yes | |yes | ||
|{{#tag:ref|{{{ | |{{#tag:ref|{{{url|}}}|name={{{name}}}|group=lower-alpha}} | ||
|{{ | |{{ | ||
#if:{{{group|}}} | #if:{{{group|}}} | ||
|{{#tag:ref|{{{ | |{{#tag:ref|{{{url|}}}|name={{{name}}}|group={{{group}}}}} | ||
|{{#tag:ref|{{{ | |{{#tag:ref|{{{url|}}}|name={{{name}}}}} | ||
}} | }} | ||
}} | }} | ||
| Line 14: | Line 14: | ||
#ifeq:{{{alpha}}} | #ifeq:{{{alpha}}} | ||
|yes | |yes | ||
|{{#tag:ref|{{{ | |{{#tag:ref|{{{url|}}}|group=lower-alpha}} | ||
|{{ | |{{ | ||
#if:{{{group|}}} | #if:{{{group|}}} | ||
|{{#tag:ref|{{{ | |{{#tag:ref|{{{url|}}}|group={{{group}}}}} | ||
|{{#tag:ref|{{{ | |{{#tag:ref|{{{url|}}}}} | ||
}} | }} | ||
}} | }} | ||
}}</includeonly><noinclude> | }}</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]]. | A shortcut for creating a reference in an article. Call this with the syntax <tt><nowiki>{{ref|url=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. Equals signs can occur in URLs, so you will encounter this situation when writing citation references. The equals sign is escaped with the use of <tt><nowiki>{{=}}</nowiki></tt> and the pipe with <tt><nowiki>{{!}}</nowiki></tt>. | If the text that you pass in contains a '=' or '|' (pipe), you need to escape them because they have special meanings in template calls. Equals signs can occur in URLs, so you will encounter this situation when writing citation references. The equals sign is escaped with the use of <tt><nowiki>{{=}}</nowiki></tt> and the pipe with <tt><nowiki>{{!}}</nowiki></tt>. | ||