Template:Reflist

From Anarchy Online Wiki [AOWiki]
1 }}
     | -moz-column-width: {{{1}}}; -webkit-column-width: {{{1}}}; column-width: {{{1}}};
     | {{#switch:|1=|2=-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em;|#default=-moz-column-width: 25em; -webkit-column-width: 25em; column-width: 25em;}} }}
   | {{#if: 
     | -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }} list-style-type: {{#switch: 
   | upper-alpha
   | upper-roman
   | lower-alpha
   | lower-greek
   | lower-roman = {{{group}}}
   | #default = decimal}};">
<references group="" responsive="{{#if:|0|1}}"></references>
Template documentation[view] [edit] [history] [purge]

{{#ifeq:reflist |doc

    | 

{{#ifeq:show |show

|
        }}{{#if: |
         |   {{#ifexist:Template:Reflist
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  |
                 }}
        }}
    | 
   }}

<templatestyles src="Template:Ombox/styles.css" />

<templatestyles src="Template:Ombox/styles.css" />

This citation template provides formatting and organizational features for footnotes. It encapsulates the {{#switch:s

 |c|close =
 |e|empty|s|single|v|void
 |o|open
 |p|pair = <references{{#if:| {{{params}}}}}
}}{{#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>}}
}} tag used by the Cite{{#ifeq: |bug| bug list}} MediaWiki extension to show the list of references as defined by {{#switch:o
 |c|close =
 |e|empty|s|single|v|void
 |o|open
 |p|pair = <ref{{#if:| {{{params}}}}}
}}{{#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>}}
}} tags. It adds support for sizing the column width, groups and List-defined references.

Parameters[edit]

There are no required parameters; if none are supplied, a single-column list will be generated if there are fewer than 10 references in the list. If you have more than 10 references, it will use columns of 30em wide if your device allows this.

Optional parameters are:

  • Unnamed parameter (must be the first one if used): the minimum width for each column of references, typically in ems. Syntax (for example) |{{#if:|=}}30em with no space (i.e. not |{{#if:|=}}30 em). Note that this replaces colwidth�see � Obsolete parameters.
  • refs: used with List-defined references.
  • group: identifies by name the subset of references to be rendered; the value should correspond to that used inline, e.g., {{{{#if: |subst:}}Reflist{{#if:group=groupname ||group=groupname}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||}}}} renders all references with groupname as the group name ({{#switch:o
 |c|close =
 |e|empty|s|single|v|void
 |o|open
 |p|pair = <ref{{#if:group=groupname| group=groupname}}
}}{{#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>}}
}}). There are five pre-defined group names that style the list differently. See � Grouped references below.
  • liststyle: specifies the style used when the reference list is rendered. The default is a numbered list. When set, it will override the style set by the |{{#if:group|group=}} parameter, without affecting group functionality. See � List styles below.

Usage[edit]

{{#if:Using only footnote-style references ||+ Using only footnote-style references}} {{#if: |
Markup Renders as

}}{{#if:Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> ==References== {{Reflist}}

Lorem ipsum.<ref>Source name, access date, etc.</ref>

Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

==References==
{{Reflist}}

Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

References
1 }}
-moz-column-width: {{{1}}}; -webkit-column-width: {{{1}}}; column-width: {{{1}}}; 1=|2=-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em;|#default=-moz-column-width: 25em; -webkit-column-width: 25em; column-width: 25em;}} }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }} list-style-type: {{#switch: upper-alpha upper-roman lower-alpha lower-greek lower-roman = {{{group}}} #default = decimal}};"> <references group="" responsive="{{#if:|0|1}}"></references>
}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}
{{#if:Using only bibliographical style references (no direct references from the text) ||+ Using only bibliographical style references (no direct references from the text)}} {{#if: |
Markup Renders as

}}{{#if:Lorem ipsum. Lorem ipsum dolor sit amet. ==References== {{Refbegin}} * reference 1 * reference 2 {{Refend}}

Lorem ipsum. Lorem ipsum dolor sit amet.

==References==
{{Refbegin}}
* reference 1
* reference 2
{{Refend}}

Lorem ipsum. Lorem ipsum dolor sit amet.

References
1 }}
references-column-width references-column-count references-column-count-{{#if:1|{{{1}}}}} }} {{#if: references-column-width }} }}" style="{{#if: {{#iferror: {{#ifexpr: 1 > 1 }} {{{1}}}}}; -webkit-column-width: {{#if:1|{{{1}}}}}; column-width: {{#if:1|{{{1}}}}}; Template:Column-count }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }}">{{#if: }}
  • reference 1
  • reference 2
}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}
{{#if:Using both footnote-style and bibliography-style references ||+ Using both footnote-style and bibliography-style references}} {{#if: |
Markup Renders as

}}{{#if:Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> ==References== {{Reflist}} {{Refbegin}} * reference 1 * reference 2 {{Refend}}

Lorem ipsum.<ref>Source name, access date, etc.</ref>

Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

==References==
{{Reflist}}

{{Refbegin}}
* reference 1
* reference 2
{{Refend}}

Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

References
1 }}
-moz-column-width: {{{1}}}; -webkit-column-width: {{{1}}}; column-width: {{{1}}}; 1=|2=-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em;|#default=-moz-column-width: 25em; -webkit-column-width: 25em; column-width: 25em;}} }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }} list-style-type: {{#switch: upper-alpha upper-roman lower-alpha lower-greek lower-roman = {{{group}}} #default = decimal}};"> <references group="" responsive="{{#if:|0|1}}"></references>
1 }}
references-column-width references-column-count references-column-count-{{#if:1|{{{1}}}}} }} {{#if: references-column-width }} }}" style="{{#if: {{#iferror: {{#ifexpr: 1 > 1 }} {{{1}}}}}; -webkit-column-width: {{#if:1|{{{1}}}}}; column-width: {{#if:1|{{{1}}}}}; Template:Column-count }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }}">{{#if: }}
  • reference 1
  • reference 2
}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}

Columns[edit]

{{{{#if: |subst:}}Reflist{{#if:30em ||30em}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||}}}} (for example) instructs the browser to create as many columns as possible (of width at least 30 em, in this example) given the width of the display window. (Units supported are em, ex, in, cm, mm, pt, pc, px, but em is almost always used.) There must not be a space between the number and the unit.

Choose a width appropriate to the typical width of the references:

Example[edit]

{{#if:15em wide columns (vary width of display window to see change in number of columns) ||+ 15em wide columns (vary width of display window to see change in number of columns)}} {{#if: |
Markup Renders as

}}{{#if:Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> ==References== {{Reflist|15em}}

Lorem ipsum.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>
Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

==References==
{{Reflist|15em}}

Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref>

References
1 }}
-moz-column-width: 15em; -webkit-column-width: 15em; column-width: 15em; 1=|2=-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em;|#default=-moz-column-width: 25em; -webkit-column-width: 25em; column-width: 25em;}} }} {{#if: -moz-column-width: {{{colwidth}}}; -webkit-column-width: {{{colwidth}}}; column-width: {{{colwidth}}}; }} }} list-style-type: {{#switch: upper-alpha upper-roman lower-alpha lower-greek lower-roman = {{{group}}} #default = decimal}};"> <references group="" responsive="{{#if:15em|0|1}}"></references>
}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}
  • Note 1: The syntax {{{{#if: |subst:}}Reflist{{#if:2 ||2}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||}}}} (for example), which specifies two columns of equal width regardless of the available display width, is deprecated (and is disabled for mobile view). When you use 1 the template gives you a single column while 2 will pretend you specified 30em. When using higher column counts, it will pretend you specified 25em.
  • Note 2: Browser support: Internet Explorer 10+, Microsoft Edge, Firefox 2+, Chrome 4+, Safari 3.1+, Opera 11.1+

List-defined references[edit]

A list of references may be defined within {{Reflist}} using the |{{#if:refs|refs=}} parameter, just like including named {{#switch:pair

 |c|close =
 |e|empty|s|single|v|void
 |o|open
 |p|pair = <ref{{#if:name="..."| name="..."}}
}}{{#switch:pair
 |c|close = 
 |e|empty|s|single|v|void =  />
 |o|open = >
 |p|pair = {{#ifeq:ref|!--||>}}...
}}{{#switch:pair
 |e|empty|s|single|v|void
 |o|open =
 |c|close
 |p|pair = {{#ifeq:ref|!--|-->|</ref>}}
}} elements inside the {{#switch:pair
 |c|close =
 |e|empty|s|single|v|void
 |o|open
 |p|pair = <references{{#if:| {{{params}}}}}
}}{{#switch:pair
 |c|close = 
 |e|empty|s|single|v|void =  />
 |o|open = >
 |p|pair = {{#ifeq:references|!--||>}}...
}}{{#switch:pair
 |e|empty|s|single|v|void
 |o|open =
 |c|close
 |p|pair = {{#ifeq:references|!--|-->|</references>}}
}} container.

Example[edit]

{{#if: ||+ {{{title}}}}} {{#if: |
Markup Renders as

}}{{#if:This is reference 1.<ref name="refname1" /> This is reference 2.<ref name="refname2" /> ==References== {{Reflist|refs= <ref name="refname1">content1</ref> <ref name="refname2">content2</ref> }}

This is reference 1.<ref name="refname1" />
This is reference 2.<ref name="refname2" />

==References==
{{Reflist|refs=
<ref name="refname1">content1</ref>
<ref name="refname2">content2</ref>
}}
}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if:  | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}{{#if: | 

}}

Grouped references[edit]

References can be grouped into separate sections (for explanatory notes, table references, and the like) via group=:

{{#switch:open
 |c|close =
 |e|empty|s|single|v|void
 |o|open
 |p|pair = <ref{{#if:group=groupname| group=groupname}}
}}{{#switch:open
 |c|close = 
 |e|empty|s|single|v|void =  />
 |o|open = >
 |p|pair = {{#ifeq:ref|!--||>}}...
}}{{#switch:open
 |e|empty|s|single|v|void
 |o|open =
 |c|close
 |p|pair = {{#ifeq:ref|!--|-->|</ref>}}
}}

where groupname is (for example) notes or sources. The group name need not be enclosed in quotes; this differs from the footnote marker where quotes are required if the group name includes a space.

Each group used in the article must have a matching reference list:

{{{{#if: |subst:}}Reflist{{#if:group=groupname ||group=groupname}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||}}}}

Predefined groups[edit]

There are predefined group names that automatically set the labels in the footnote markers and the reference list to other styles. Thus, setting {{Reflist|group=lower-alpha}} will set the group to lower-alpha and will style the reference list with lower alpha characters. The matching footnote marker can be formed by {{#switch:pair

 |c|close =
 |e|empty|s|single|v|void
 |o|open
 |p|pair = <ref{{#if:group=lower-alpha| group=lower-alpha}}
}}{{#switch:pair
 |c|close = 
 |e|empty|s|single|v|void =  />
 |o|open = >
 |p|pair = {{#ifeq:ref|!--||>}}...
}}{{#switch:pair
 |e|empty|s|single|v|void
 |o|open =
 |c|close
 |p|pair = {{#ifeq:ref|!--|-->|</ref>}}
}}. This is made easier by a series of templates to set the group/label styles for the footnote marker and the reference list:

{{#section:Help:Footnotes|pregrouptable}}

List styles[edit]

As noted in � Predefined groups, there are predefined groups that automatically add list styling. Using the listed templates is more convenient than using |{{#if:liststyle|liststyle=}}.

Reference lists are by default numbered lists. By using the |{{#if:liststyle|liststyle=}} parameter, you can control how the list is rendered. For example, using |{{#if:liststyle|liststyle=}}upper-roman will result in references being labeled with Roman numerals instead of decimal numbers. The parameter accepts any valid CSS value defined for list-style-type as shown below. {{#ifeq:right|left

|