Difference between revisions of "Template:Reflist"

From Captain of Industry Wiki
Jump to: navigation, search
(Creation)
 
(Replace with current code version from Wikipedia)
 
Line 1: Line 1:
<div class="reflist reflist-columns references-column-width" {{#if: {{{nocols|}}}||style="column-width: {{{colwidth|30em}}} }};" |}}>
<templatestyles src="Reflist/styles.css" /><div class="reflist <!--
<references /></div><noinclude>
-->{{#if:{{{1|}}}{{{colwidth|}}}|reflist-columns references-column-width}} <!--
{{documentation}}</noinclude>
-->{{#switch:{{{group|}}}|upper-alpha|upper-roman|lower-alpha|lower-greek|lower-roman=reflist-{{{group}}}}} <!--
-->{{#if:{{{1|}}}|{{#iferror:{{#ifexpr: {{{1|1}}} > 1 }}||{{#switch:{{{1|}}}|1=|2=reflist-columns-2|#default=reflist-columns-3}} }}}}" <!-- end class
-->{{#if:{{{1|}}}{{{colwidth|}}}{{{liststyle|}}}|<!-- start style
-->style="{{#if: {{{1|}}}
    | {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }} |column-width: {{{1}}};}}
    | {{#if: {{{colwidth|}}}|column-width: {{{colwidth}}};}}
    }} <!--
-->{{#if:{{{group|}}}||{{#if:{{{liststyle|}}}|list-style-type: {{{liststyle}}};}}}}"<!--
-->}}>
{{#tag:references|{{{refs|}}}|group={{{group|}}}|responsive={{#if:{{{1|}}}{{{colwidth|}}}|0|1}}}}</div>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using reflist with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Reflist]] with unknown parameter "_VALUE_"|ignoreblank=y| 1 | colwidth | group | liststyle | refs }}<noinclude>
{{Documentation}}
</noinclude>

Latest revision as of 09:37, 22 January 2022

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]

This citation template provides formatting and organizational features for footnotes. It encapsulates the <references> tag used by the cite.php MediaWiki extension to show the list of references as defined by <ref> tags. It adds support for sizing the column width, groups and list-defined references.

Parameters

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) {{reflist|30em}} with no space (i.e. not {{reflist|30 em}}). Note that this replaces colwidth—see Obsolete parameters section.
  • 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., {{Reflist|group=groupname}} renders all references with groupname as the group name. There are five pre-defined group names that style the list differently. See § 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 group parameter, without affecting group functionality. See § below.

Usage

Using only footnote-style references
Markup Renders as
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.[1] Lorem ipsum dolor sit amet.[2]

References
  1. Source name, access date, etc.
  2. Source name, access date, etc.

Columns

{{Reflist|30em}} (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. Percent is not supported.

Example

15em wide columns (vary width of display window to see change in number of columns)
Markup Renders as
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.[1] Lorem ipsum dolor sit amet.[2] Lorem ipsum dolor sit amet.[3] Lorem ipsum dolor sit amet.[4] Lorem ipsum dolor sit amet.[5]

References
  1. Source name, access date, etc.
  2. Source name, access date, etc.
  3. Source name, access date, etc.
  4. Source name, access date, etc.
  5. Source name, access date, etc.

The syntax {{Reflist|2}} (for example), which specifies two columns of equal width regardless of the available display width, is deprecated. 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.

Technical details

Font size

The font size should reduce to 90% for most browsers, but may appear to show at 100% for Internet Explorer and possibly other browsers.[general 1] As of December 21, 2010, the standard <references> tag has the same font styling. The smaller font may be disabled through.

Browser support for columns

Multiple columns are generated by using CSS3, which is still in development; thus only browsers that properly support the multi-column property will show multiple columns with {{Reflist}}.

These browsers support CSS3 columns:

These browsers do not support CSS3 columns:

Obsolete parameters

These parameters are no longer in use:

  • colwidth: Same as specifying a column-width for the first unnamed parameter. Replaced by width as unnamed first parameter.

Limitations

Do not use {{Reflist}} or other templates or modules that use <:references> in numbered or unnumbered lists if the list is inside an HTML div tag.
The above text is transcluded from Template:Reflist/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (create | mirror ) and testcases (create) pages.
Please add categories and interwikis to Template:Reflist/doc. (View all subpages of this page.)


Cite error: <ref> tags exist for a group named "general", but no corresponding <references group="general"/> tag was found