Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  



























Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1Elements
 




2Messages
 




3Classes and CSS
 




4Reference links
 




5Backlink labels
 




6Markup
 













Help:Cite messages







Add links
 









Help page
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 


















From Wikipedia, the free encyclopedia
 


The Wikipedia footnotes system uses the Cite.php software extension to generate references. MediaWiki messages are then used to format the display of the inline links and the references.

Elements[edit]

Messages[edit]

MediaWiki interface page Use Current
Cite reference link format inline link <sup id="$1" class="reference">[[#$2|&#91;$3&#93;]]</sup>
  1. ref ID: Cite reference link prefix + reference name + numeric starting with 0
  2. backlink ID
  3. count to display
Cite references link many format reference with multiple backlinks <li id="$1"><span class="mw-cite-backlink">^ $2</span> $3</li>
  1. backlink ID
  2. list of links
  3. text of note
Cite references link many and
Cite references link many format [[#$1|<sup>'''''$3'''''</sup>]]
  1. ref ID
  2. numeric value to use as a backlink
  3. custom value to use as a backlink as defined in MediaWiki:Cite references link many format backlink labels
Cite references link many format backlink labels backlink labels used in the reference list currently from a to azz
Cite references link many sep
Cite references link one format reference with single backlink <li id="$1"$4><span class="mw-cite-backlink">'''[[#$2|^]]'''</span> $3</li>
  1. backlink ID - used for creating the number order of the source list.
  2. ref ID - used to link back to the actual reference in the text
  3. text of note - text used above describing the source info
Cite references prefix prefix for <references /> [[:MediaWiki:Cite references prefix]]
Cite references suffix suffix for <references /> [[:MediaWiki:Cite references suffix]]
Cite reference link key with num [[:MediaWiki:Cite reference link key with num]]
  1. key
  2. num
Cite reference link prefix inline link prefix [[:MediaWiki:Cite reference link prefix]]
Cite reference link suffix inline link suffix [[:MediaWiki:Cite reference link suffix]]
Cite references link prefix reference list link prefix [[:MediaWiki:Cite references link prefix]]
Cite references link suffix reference list link suffix [[:MediaWiki:Cite references link suffix]]
Cite references no link [[:MediaWiki:Cite references no link]]
Cite references link many accessibility label accessibility label for screen readers Jump up to:

Classes and CSS[edit]

Class .reference formats the inline link; defined in Common.css

/* Ensure refs in table headers and the like aren't bold or italic */
sup.reference {
    font-weight: normal;
    font-style: normal;
}

/* Prevent line breaks in silly places:
3) Ref tags with group names <ref group="Note"> --> "[Note 1]"
*/
sup.reference a {
    white-space: nowrap;
}


Class .references formats the reference list; defined in Common.css When the inline cite link is clicked, the focus jumps to the proper cite in the reference list. The following rules highlight the cite in light blue. This is supported by Gecko (FireFox) and Webkit (Safari, Chrome) browsers; it is not supported by current versions of Trident, but does work in the Internet Explore 9 platform preview.

/* Highlight clicked reference in blue to help navigation */
div.references li:target,
sup.reference:target,
span.citation:target {
    background-color: #DEF;
}


Although not specific to references, Common.css does have this line height rule to keep line spacing from breaking on subscript and superscript, as used in the inline link. Internet Explorer 7 has problems with line-height when printing, so it is disabled for IE7 through Common.js.

/* Reduce line-height for <sup> and <sub> */
sup, sub {
    line-height: 1em;
}

Cite errors are classed with:

<strong class="error mw-ext-cite-error">

The extension uses some modules for CSS:

Reference links[edit]

The inline reference links are defined in MediaWiki:Cite reference link. The default is:

<sup id="$1" class="reference">[[#$2|<nowiki>[</nowiki>$3<nowiki>]</nowiki>]]</sup>

Where:

The English Wikipedia customizes this to:

<sup id="$1" class="reference">[[#$2|&#91;$3&#93;]]</sup>

Where the brackets that show enclosing the reference count are enclosed in <span> tags so they can be styled.

Backlink labels[edit]

The backlink label type is defined in MediaWiki:Cite references link many format. This interface page defaults to:

[[#$1|<sup>'''''$2'''''</sup>]]

Where:

The English Wikipedia interface page is set to:

[[#$1|<sup>'''''$3'''''</sup>]]

Changing $2to$3 changes the backlinks from numeric to alpha. This was modified in 2006 to match the output of {{ref}} which was the predominant method of inserting footnotes at the time.

Markup[edit]

This is the markup for some simple references

Unnamed <ref>This is an unnamed reference</ref>

Named <ref name="named">This is a named reference</ref>

Named reference used again <ref name="named"/>
<references/>

Which shows as

Unnamed [1]

Named [2]

Named reference used again [2]

  1. ^ This is an unnamed reference
  • ^ a b This is a named reference
  • Which renders as

    The MediaWiki messages are combined to form the HTML output

    <p>Unnamed <sup id="cite_ref-0" class="reference"><a href="#cite_note-0" title=""><span>[</span>1<span>]</span></a></sup></p>
    <p>Named <sup id="cite_ref-named_1-0" class="reference"><a href="#cite_note-named-1" title=""><span>[</span>2<span>]</span></a></sup></p>
    <p>Named reference used again <sup id="cite_ref-named_1-1" class="reference"><a href="#cite_note-named-1" title=""><span>[</span>2<span>]</span></a></sup></p>
    <div class="references">
    <ol>
    <li id="cite_note-0"><b><a href="#cite_ref-0" title="">^</a></b> This is an unnamed reference</li>
    <li id="cite_note-named-1">^ <a href="#cite_ref-named_1-0" title=""><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-named_1-1" title=""><sup><i><b>b</b></i></sup></a> This is a named reference</li>
    </ol>
    </div>
    

    Ifcitation templates are used, they will inject other classes and ids into the HTML output.


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Help:Cite_messages&oldid=1155220496"

    Category: 
    Wikipedia how-to
     



    This page was last edited on 17 May 2023, at 06:38 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki