Changes

Jump to navigation Jump to search
6,400 bytes added ,  12:14, 12 March 2022
Import from wikipedia
{{redirect|H:CE|conditional expressions|Help:Conditional expressions}}
{{information page|H:CE}}

The Wikipedia [[Wikipedia:Footnotes|footnotes]] system has the ability to detect errors. This page documents the error messages and provides an understanding of the problem and solutions.

==Error messages==
The messages will be formatted as <strong class="error">an error</strong>, and are visible on the rendered page after hitting the "Publish changes" button.

These messages are dependent on the language setting in [[Special:Preferences]]— this list applies only to "en&nbsp;— English".

{{Help:Cite errors/header2|msg=Cite error ref no input}}
{{Help:Cite errors/header2|msg=Cite error ref no key}}
{{Help:Cite errors/header2|msg=Cite error ref too many keys}}
{{Help:Cite errors/header2|msg=Cite error ref numeric key}}
{{Help:Cite errors/header2|msg=Cite error included ref}}
{{Help:Cite errors/header2|msg=Cite error references no text}}
{{Help:Cite errors/header2|msg=Cite error references invalid parameters}}
{{Help:Cite errors/header2|msg=Cite error references no backlink label}}
{{Help:Cite errors/header2|msg=Cite error group refs without references}}
{{Help:Cite errors/header2|msg=Cite error references group mismatch}}
{{Help:Cite errors/header2|msg=Cite error references missing group}}
{{Help:Cite errors/header2|msg=Cite error references missing key}}
{{Help:Cite errors/header2|msg=Cite error references no key}}
{{Help:Cite errors/header2|msg=Cite error references duplicate key}}
{{Help:Cite errors/header2|msg=Cite error empty references define}}
{{Help:Cite errors/header2|msg=Cite error}}

==Other problems==
Some problems may not show a cite error message, while others may not be obvious.

===In ref name use only straight quotation marks===
When you cite the same source more than once on a page, use only straight quotation marks <big><big>{{mxt|"&nbsp;"}}</big></big> to enclose the reference name. Do not use curly quotation marks <big><big>{{!mxt|“&nbsp;”}}</big></big>, which are treated as simply another character, not as quotation marks. An error message will appear if the original and repeat references use a mix of straight and curly quotation marks.
The syntax to define a named reference is:
:{{tag|ref|params=name=<var>"name"</var>|content=<var>content</var>}}
To repeat the named reference:
:{{tag|ref|s|params=name=<var>"name"</var>}}

===A page shows in the reference error category, but no cite errors show===
If {{tag|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 &amp;#61;

refTools should catch this problem.

For example, an incorrectly nested reference where {{tl|lower}} is being used to make the reference smaller:
{{pre|<nowiki>{{lower|<ref>content1<ref>content2</ref>[http://www.washingtoninstitute.org/templateC05.php?CID=2386]</ref>}}</nowiki>}}

===Reference links show in the body of the article, but do not show in the reference list===
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:
:{{Tag|1=ref name="foo"|2=open}}''content1''{{Tag|ref|close}}
:{{Tag|1=ref name="foo"|2=open}}''content2''{{Tag|ref|close}}
Only ''content1'' will show. refTools will catch this problem.

===Content on a non-article page is missing===
If a footnote does not have a closing {{Tag|ref|close}}, 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 {{Tag|references|single}} tag, generating an error, but the message for a missing {{Tag|references|single}} tag is suppressed on non-article pages. refTools will catch this problem.

===Templates===
Some templates may include {{Tag|ref}} tags; for example {{Tl|botanist}}. If a template of this type in included without the {{Tag|references|single}} 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 {{Tag|references|single}} there.

'''Method 2'''

Add the following code to the end of the template:
<pre>
<noinclude>
{{Template reference list}}
</noinclude>
</pre>

'''Method 3'''

Add the following code to the end of the template:
<pre>
<noinclude>
<div style="display: none"><references /></div>
</noinclude>
</pre>

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 {{Tag|references|single}} tag within the template itself using the <code>group</code> parameter. See [[Help talk:Cite errors/Testcases1]] for an example.

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==
[[Wikipedia:RefToolbar|refTools]] can be enabled via {{myprefs|3|Usability features}}. It includes an error checking tool for common problems.

==Messages, namespaces and categories==
Internal messages are generated by the [[mw:Extension:Cite/Cite.php|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 {{Tl|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 <nowiki>{{PAGENAME}}</nowiki> for the main namespace and by <nowiki>τ{{PAGENAME}}</nowiki> for template, category, help and file namespaces.

== See also ==
* [[Help:CS1 errors]]: Messages and solutions for errors occurring ''inside'' of a reference as issued by [[Help:Citation Style 1|Citation Style 1]] templates

{{Wikipedia referencing}}
{{Help navigation}}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu