Help:Cite errors
The MediaWiki footnotes system has the ability to detect errors. This page documents the error messages and provides an understanding of the problem and solutions.
Overview[edit]
Cite.php is the software extension for the footnotes system. Two HTML-style tags are used to define and show the references.
<ref>
Single use footnotes are defined by enclosing content within <ref>...</ref>
:
<ref>content</ref>
A footnote used multiple times may be defined with a name:
<ref name="foo">
content</ref>
To invoke a named footnote:
<ref name="foo" />
Footnotes may be defined in groups:
<ref group="foo">
content</ref>
<references />
To display the reference list, after all of the <ref>...</ref>
tags, include:
<references />
To display a list of references defined in a group, include:
<references group="foo" />
Names[edit]
Names for footnotes and groups must follow these rules:
- Names are case-sensitive
- Names may not be purely numeric
- Quotes are optional if the only characters used are letters A–Z, a–z, digits 0–9 and the symbols !$%&()*,-.:;<@[]^_`{|}~
- Inclusion of any other characters including spaces requires that the name be enclosed in straight quotes (")
- Quote-enclosed names may not include a less-than sign (<) or a quote symbol (")
- Please consider keeping names simple and restricted to the standard English alphabet and numerals.
- You may optionally provide names even when the name is not required.
Templates[edit]
Several templates have been developed for use with references:
- {{Reflist}} adds the
<references />
tag with some formatting options
Error messages[edit]
The messages will be formatted as an error.
These messages are dependent on the language setting in Special:Preferences— this list applies only to "en — English."
There are <ref> tags on this page without content in them (see the help page).
|
Help page |
Invalid <ref> tag; references with no content must have a name (see the help page).
|
Help page |
The <ref> tag has too many names (see the help page).
|
Help page |
Invalid <ref> tag; name cannot be a simple integer— use a descriptive title (see the help page).
|
Help page |
A set of <ref> tags are missing the closing </ref> (see the help page).
|
Help page |
Invalid <ref> tag; no text was provided for refs named $1 (see the help page).
|
Help page |
Invalid <references> tag; no parameters are allowed. Use <references/> (see the help page).
|
Help page |
Invalid <ref> tag; parameter "group" is allowed only. Use the {{Reflist}} template, <references/> , or <references group="..."/> (see the help page).
|
Help page |
There are <ref> tags on this page, but the references will not show without a {{reflist}} template (see the help page).
|
Help page |
Ran out of custom backlink labels (see the help page).
|
Help page |
There are <ref group=$1> tags on this page, but the references will not show without a {{reflist|group=$1}} template (see the help page).
|
Help page |
<ref> tag in <references> has conflicting group attribute "$1" (see the help page).
|
Help page |
MediaWiki:Cite error references missing group |
Help page |
<ref> tag with name "$1" defined in <references> is not used in prior text (see the help page).
|
Help page |
<ref> tag defined in <references> has no name attribute (see the help page).
|
Help page |
<ref> tag defined in <references> with name "$1" has no content (see the help page).
|
Help page |
The named reference "$1" was defined multiple times with different content (see the help page).
|
Help page |
MediaWiki:Cite error key str invalid |
Help page |
MediaWiki:Cite error stack invalid input |
Help page |
MediaWiki:Cite croak |
Help page |
Cite error: $1
|
Help page |
Other problems[edit]
Some problems may not show a cite error message, while others may not be obvious.
A page shows in the reference error category, but no cite errors show[edit]
If <ref>...</ref>
includes a URL with an =, and if the reference is inside a template, then the template will fail. Depending on the placement of the URL, the cite error message may not display, but the page will be included in the error category. Ensure that = are encoded as =
refTools should catch this problem.
Reference links show in the body of the article, but do not show in the reference list[edit]
This may be caused by a template that is not properly closed with }}.
It can also be caused by multiple footnotes that are defined to use the same name. Links will be generated for both, but only the first will show in the references list: For example:
<ref name="foo">
content1</ref>
<ref name="foo">
content2</ref>
Only content1 will show. refTools will catch this problem.
Content on a non-article page is missing[edit]
If a footnote does not have a closing </ref>
, it will "eat" the following text, causing it to not show. This normally shows a cite error, unless it is the last footnote on the page. Normally, this would then suppress the <references />
tag, generating an error, but the message for a missing <references />
tag is suppressed on non-article pages. refTools will catch this problem.
Templates[edit]
Some templates may include <ref>...</ref>
tags. If a template of this type in included without the <references />
tag, then an error is generated, but the problem is not obvious. refTools will not catch this problem.
Several methods are available for solving this problem. Below they are listed in order of preference. Note that only one of these is required, not all of them.
Method 1
If the template has a documentation page, add <references />
there.
Method 2
Add the following code to the end of the template:
<noinclude> {{Template reference list}} </noinclude>
Method 3
Add the following code to the end of the template:
<noinclude> <div style="display: none"><references /></div> </noinclude>
Cons: Hides the references, not informing the user that it is there; editors won't be able to check the references formatting.
Method 4
Include the <references />
tag within the template itself using the group
parameter.
Cons: Creates a separate references section that may not be obvious; does not allow reuse of the references within the body of the article.
Tools[edit]
refTools can be enabled via Preferences → Editing → Usability features. It includes an error checking tool for common problems.
Messages, namespaces and categories[edit]
Internal messages are generated by the Cite.php extension and shown as a MediaWiki message. See the parser hooks section of Special:Version for the installed version of Cite.php. These messages are in the MediaWiki namespace and can be modified only by admins.
The MediaWiki messages use {{broken ref}} to control the namespace and category. Messages show only on main (article), user, template, category, help and file pages. Talk pages do not show error messages.
Category default sorting is by {{PAGENAME}} for the main namespace and by τ{{PAGENAME}} for template, category, help and file namespaces.