:Help:Cite messages

{{Wikipedia how to|H:CITEMSG}}

{{notice|This is a very technical how-to mainly of interest to editors who work with the footnotes system and related templates}}

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

  • Inline link: the link shown by the content enclosed in {{tag|ref}}; shown in superscript and enclosed in brackets; coded in the MediaWiki message as $2
  • Backlink: the link shown in the references section; a single link is shown as a caret; coded as $2
  • Backlink label: multiple backlinks are shown as a caret followed alpha character labels
  • ID: a unique HTML ID that does not show; coded as $1
  • Reference content: the content enclosed in {{tag|ref}} that shows in the reference list; coded as $3

Messages

class="wikitable"
MediaWiki interface pageUseCurrent
Cite reference linkformat inline link{{code|{{MediaWiki:Cite reference link}}|wikitext}}

  1. ref ID: Cite reference link prefix + reference name + numeric starting with 0
  2. backlink ID
  3. count to display
Cite references link manyformat reference with multiple backlinks{{code|{{MediaWiki:Cite references link many}}|wikitext}}
  • backlink ID
  • list of links
  • text of note
  • Cite references link many and{{code|{{MediaWiki:Cite references link many and}}|wikitext}}
    Cite references link many format{{code|{{MediaWiki:Cite references link many format}}|wikitext}}
  • ref ID
  • numeric value to use as a backlink
  • custom value to use as a backlink as defined in MediaWiki:Cite references link many format backlink labels
  • Cite references link many format backlink labelsbacklink labels used in the reference listcurrently from a to azz
    Cite references link many sep{{code|{{MediaWiki:Cite references link many sep}}|wikitext}}
    Cite references link oneformat reference with single backlink{{code|{{MediaWiki:Cite references link one}}|wikitext}}
  • backlink ID - used for creating the number order of the source list.
  • ref ID - used to link back to the actual reference in the text
  • text of note - text used above describing the source info
  • Cite references prefixprefix for {{tag|references|single}}{{code|{{MediaWiki:Cite references prefix}}|wikitext}}
    Cite references suffixsuffix for {{tag|references|single}}{{code|{{MediaWiki:Cite references suffix}}|wikitext}}
    Cite reference link key with num{{code|{{MediaWiki:Cite reference link key with num}}|wikitext}}
  • key
  • num
  • Cite reference link prefixinline link prefix{{code|{{MediaWiki:Cite reference link prefix}}|wikitext}}
    Cite reference link suffixinline link suffix{{code|{{MediaWiki:Cite reference link suffix}}|wikitext}}
    Cite references link prefixreference list link prefix{{code|{{MediaWiki:Cite references link prefix}}|wikitext}}
    Cite references link suffixreference list link suffix{{code|{{MediaWiki:Cite references link suffix}}|wikitext}}
    Cite references no link{{code|{{MediaWiki:Cite references no link}}|wikitext}}
    Cite references link many accessibility labelaccessibility label for screen readers{{code|{{MediaWiki:Cite references link many accessibility label}}|wikitext}}

    Classes and CSS

    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 --> "[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 and */

    sup, sub {

    line-height: 1em;

    }

    Cite errors are classed with:

    The extension uses some [https://phabricator.wikimedia.org/diffusion/ECIT/browse/master/modules;530ef0ab9ccda7a5adef8547b2f5c644e156e636 modules] for CSS:

    • ext.cite.css: CSS
    • ext.cite.js: add accessibility attributes to the citation links
    • ext.rtlcite.css: isolation to fix references in case of RTL words at the end of a reference

    Markup

    This is the markup for some simple references

    Unnamed This is an unnamed reference

    Named This is a named reference

    Named reference used again

    Which shows as

    Unnamed This is an unnamed reference

    Named This is a named reference

    Named reference used again

    Which renders as

    The MediaWiki messages are combined to form the HTML output

    Unnamed [1]

    Named [2]

    Named reference used again [2]

    1. ^ This is an unnamed reference
    2. ^ a b This is a named reference

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

    {{Wikipedia referencing}}