Template:Reflist: Difference between revisions
No edit summary |
m (Protected "Template:Reflist": Template uses advanced coding: also, high use ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
(No difference)
|
Revision as of 18:12, 2 April 2011
{{reflist|2}}
On this wiki, {{reflist}} is to be placed in a section titled "Footnotes", and not alternatives like "References", in order to avoid confusion with references on story pages.
As of 2009, multi-column display is supported only in Gecko-based browsers, which includes Safari and Firefox, but excludes Internet Explorer. Pages using this template will display no differently in Internet Explorer than they do when the older <references/> tag is used.
Usage
- Using only footnote-style references
== Content == Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> == Footnotes == {{Reflist}}
- Using only bibliographical style references
== Content == Lorem ipsum. Lorem ipsum dolor sit amet. == Footnotes == {{Refbegin}} * reference 1 * reference 2 {{Refend}}
- Using both footnote-style and bibliography-style references
== Content == Lorem ipsum.<ref>Source name, access date, etc.</ref> Lorem ipsum dolor sit amet.<ref>Source name, access date, etc.</ref> Lorem ipsum. Lorem ipsum dolor sit amet. == Footnotes == {{Reflist}} {{Refbegin}} * reference 1 * reference 2 {{Refend}}
Columns
Using {{Reflist|2}} will create a two-column reference list, and {{Reflist|3}} will create a three-column list, and so on. Choose the number of columns that is appropriate for the average width of the references on the page.
Using {{Reflist|30em}} will create columns with a minimum width of 30em, allowing the browser to automatically choose the number of columns based on the width of the web browser. Choose a column width that is appropriate for the average width of the references on the page.
Columns are currently supported only by Gecko-based browsers (such as Mozilla Firefox and WebKit-based browsers (such as Google Chrome and Safari). See below for more information.
List styles
Reference lists are by default numbered lists. By using the liststyle=
parameter, you can control how the list is rendered. For example, using liststyle = upper-roman
will result in items being prefixed with roman numerals instead of decimal numbers. The parameter accepts any valid CSS value defined for list-style-type
as shown below.
Template:CSS list-style-type values
Multiple uses
If {{Reflist}} is used multiple times without a parameter, each instance will include all of the previously defined references. To force the parser to close previous references, each use of {{Reflist}} must be forced as a new instance by the use of any parameter. Even an undefined parameter such as {{Reflist}} will force the references to close.
Grouped references
As of June 2008, the footnotes system supports the separation of references into groups. This allows groups for explanatory notes, table references and the like. See WP:REFGROUP on Wikipedia for more info.
The general format for the reference tag would be:
<ref group="groupname" />
And for the reflist:
- {{Reflist|group="groupname"}}
- Where groupname would be a group identifier such as "note", "nb" or "label".
There are three pre-defined group names that will automatically cause the link labels and this template to display ohter character instead of numbers (see List styles above). These are: "lower-alpha" (a, b, c...), "lower-greek" (α, β, γ...) and "lower-roman" (i, ii, iii...).
List-defined references
As of September 2009, references may be defined within {{Reflist}} using |refs=
and invoked within the content. There are new error messages associated with this update, documented at Help:Cite errors. As usual, groups can be used. Defined references must be used within the body; unused references will show an error message.
Example
This is reference 1.<ref name="refname1" group="groupname" /> This is reference 2.<ref name="refname2" group="groupname" /> This is reference 3.<ref name="refname3" group="groupname" /> {{Reflist|group="groupname"|refs= <ref name="refname1" group="groupname">content1</ref> <ref name="refname2" group="groupname">content2</ref> <ref name="refname3" group="groupname">content3</ref> }}
Result
This is reference 1.[groupname 1] This is reference 2.[groupname 2] This is reference 3.[groupname 3]
Technical details
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}}.[1][2]
These browsers support CSS3 columns:
- Gecko-based browsers such as Mozilla Firefox
- WebKit-based browsers such as Safari and Google Chrome
- Opera from version 10.11 beta onward
These browsers do not support CSS3 columns:
- Microsoft Trident-based browsers including Internet Explorer through to version 9[3]
- Opera through to version 11
Supporting CSS
{{Reflist}} uses a CSS rule in MediaWiki:Common.css to set the font size:
div.reflist { font-size: 90%; }
One of the following classes is assigned by the template when either column count or column width is set:
.references-column-count
and.references-column-count-n
(wheren
is the numer of columns).references-column-width
The following CSS properties are utilized using the {{column-count}} and {{column-width}} templates:
column-count
CSS3 standardcolumn-width
CSS3 standard-moz-column-count
Mozilla CSS extension-moz-column-width
Mozilla CSS extension-webkit-column-count
Webkit CSS extension-webkit-column-width
Webkit CSS extension
Customizing the view
By editing your CSS, the personal appearance of the reference list can be customized. Go to User:[YourUserName]/wikia.css
to input any of the following.
- Font size
The font size for all reference lists defaults to 90% of the standard size. To change it, add:
ol.references,
div.reflist,
div.refbegin {
font-size: 90%;
}
Change 90% to the desired size.
- Columns
To disable columns, add:
.references-column-count, .references-column-width {
column-count: 1 !important;
column-width: auto !important;
-moz-column-count: 1 !important;
-moz-column-width: auto !important;
-webkit-column-count: 1 !important;
-webkit-column-width: auto !important;
}
Similarly, to force all reference lists to a number of columns, change the number.
- Column dividers
To add dividers (rules) between columns, add:
.references-column-count, .references-column-width {
column-rule: 1px solid #aaa;
-moz-column-rule: 1px solid #aaa;
-webkit-column-rule: 1px solid #aaa;
}
You can alter the appearance of the dividers by changing the values.
Footnotes
- ↑ CSS3 Multi-Column Thriller. Retrieved on November 24, 2006.
- ↑ CSS3 module: Multi-column layout. W3C. Retrieved on November 24, 2006.
- ↑ CSS Compatibility and Internet Explorer: Multi-column Layout. Microsoft. Retrieved on March 16, 2011.
To do
In 2009, the template was updated on Wikipedia to allow for the ability to define references within the body of the template itself, which can be useful in certain situations.
For example,
The quick brown fox jumps over the lazy dog.<ref name="LazyDog" group="Ref"/> Amazingly few discotheques provide jukeboxes.<ref name="Jukeboxes" group="Ref"/> How razorback-jumping frogs can level six piqued gymnasts.<ref name="JumpingFrogs" group="Ref"/> {{reflist|group="Ref"|refs= <ref name="LazyDog">This is the lazy dog reference.</ref> <ref name="Jukeboxes">This is the jukeboxes reference.</ref> <ref name="JumpingFrogs">This is the jumping frogs reference.</ref> }}
However, for reasons that are unclear as of 04:17, April 16, 2010 (UTC), this aspect of the template produces errors here on Tardis Wiki. This is what happens when you attempt to put the above example into pratice:
The quick brown fox jumps over the lazy dog.[Ref 1] Amazingly few discotheques provide jukeboxes.[Ref 2] How razorback-jumping frogs can level six piqued gymnasts.[Ref 3]
It does no particular harm to have the template producing these errors, because this is not an aspect of the template that is actually used on Tardis at the moment. Thus the error will simply be recorded here until a solution can be found.
Note that as of 04:17, April 16, 2010 (UTC) the template has been slightly altered from its state on Wikipedia, in that a double-pipe workaround has been attempted. The "meat" of the code is this:
{{#tag:references|{{{refs|}}}|group={{{group|}}}}}
However, this presents the error code:
Invalid <references> tag; no input is allowed. Use <refereces/>.
Going on advice from an error-reporting thread, double piping (|| as opposed to | to separate variable definitions) was attempted, thus:
{{#tag:references||{{{refs|}}}||group={{{group|}}}}}
This actually solves the error message reported above. Unfortunately, it introduces the wholly different error of:
Invalid <ref> tag; no text was provided for refs named [refname]
Different combinations of piping have been rather randomly tried, but all to no avail.
Solution
This problem definitively identified as having to do with the version of Cite.php used on this site. The latest version for our version of MediaWiki (1.15.x) is 48711, and we're considerably back at 47190. Upgrading will almost certainly make this aspect of the template work.