Template:Ref: Difference between revisions

From OniGalore
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|{{{1|}}}|name={{{name}}}|group=lower-alpha}}
     |{{#tag:ref|{{{url|}}}|name={{{name}}}|group=lower-alpha}}
     |{{
     |{{
       #if:{{{group|}}}
       #if:{{{group|}}}
       |{{#tag:ref|{{{1|}}}|name={{{name}}}|group={{{group}}}}}
       |{{#tag:ref|{{{url|}}}|name={{{name}}}|group={{{group}}}}}
       |{{#tag:ref|{{{1|}}}|name={{{name}}}}}
       |{{#tag:ref|{{{url|}}}|name={{{name}}}}}
     }}
     }}
   }}
   }}
Line 14: Line 14:
     #ifeq:{{{alpha}}}
     #ifeq:{{{alpha}}}
     |yes
     |yes
     |{{#tag:ref|{{{1|}}}|group=lower-alpha}}
     |{{#tag:ref|{{{url|}}}|group=lower-alpha}}
     |{{
     |{{
       #if:{{{group|}}}
       #if:{{{group|}}}
       |{{#tag:ref|{{{1|}}}|group={{{group}}}}}
       |{{#tag:ref|{{{url|}}}|group={{{group}}}}}
       |{{#tag:ref|{{{1|}}}}}
       |{{#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>.

Revision as of 18:12, 18 February 2026

A shortcut for creating a reference in an article. Call this with the syntax {{ref|url=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. 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 {{=}} and the pipe with {{!}}.

If you plan to list the article's references in separate groups at the bottom of the article, use the "group" parameter to assign refs to each group: {{ref|group=group_name|Text of your reference.}}. See Oni for an example of using Ref and Reflist to do this.

If you want your references to use letters instead of numbers, use {{ref|alpha=yes|Text of your reference.}}. See Quotes/Manual for an example of how to use Ref and Reflist to do this.