Jump to content

Template:Xoldid/doc

From Meta, a Wikimedia project coordination wiki

Short syntax: {{xoldid|oldid|anchor|label|proj}}

Description

[edit]

xoldid is an alternative form of the {{oldid}}/{{oldid/}} templates, with two distinctions:

  • it has a slightly simplified positional parameter syntax, which makes copy-pasting from the oldid URL easier;
  • it supports oldids from other projects, which can be especially handy in projects like Meta, Commons, and Wikidata.

Usage

[edit]
  1. Open the history tab for the page in question.
  2. Click the revision link (the date) for the preferred old version of the page.
  3. Copy the oldid=... from the URL in the address bar.
  4. Paste it in your text, surround it with double curly brackets, add an x before oldid, and replace the equals sign after it with a pipe (“|”).
  5. If there's an anchor—a header or an HTML tag with “id” attribute”—that you want to point to, add it as the second positional parameter.
  6. If you want the link to display custom text, add it in the third positional parameter (label in the general syntax example above). Otherwise the text will simply be “oldid NNNNN”.
    Note: If the text includes the equals sign, use the format 3=some text=more text, for example {{xoldid|9999|3=here it is claimed that 2+2=5}}.
  7. If the oldid is from another WMF project, add the project shortcut from WP:INTERWIKI as a fourth positional parameter according to the following rules:
    1. The general format is project_shortcut:language_code.
    2. Use the short (shortcut) form where available, not the long one, that is, w instead of wikipedia.
    3. For projects that have no different language versions (Wikidata, Commons, Species, Simple English, etc.) omit the :language_code part.

Examples

[edit]
Simplest form, local oldid with no customization

{{xoldid|19322195}} => oldid 19322195

Local oldid with anchor

{{xoldid|19255482|New template for diff links (cross-project)}} => oldid 19255482#New template for diff links (cross-project)

Oldid from the English Wikipedia (note how positional parameters 2 and 3 are left empty)

{{xoldid|139992|||w:en}} => oldid 139992 on w:en

Oldid from the English Wikipedia with anchor (note how positional parameter 3 is left empty)

{{xoldid|6310371|Wikipedia is addictive. I should have gone to sleep 3 hours ago.||w:en}} => oldid 6310371#Wikipedia is addictive. I should have gone to sleep 3 hours ago. on w:en

Oldid from the English Wikipedia with custom text (note how positional parameter 2 is left empty)

{{xoldid|6310371||look here for “Wikipedia is addictive. I should have gone to sleep 3 hours ago.”|w:en}} => look here for “Wikipedia is addictive. I should have gone to sleep 3 hours ago.”

Oldid from the English Wikipedia with anchor (note how positional parameter 3 is left empty)

{{xoldid|6310371|Wikipedia is addictive. I should have gone to sleep 3 hours ago.|We are being zombified from the very beginning... Somebody, please... HELP!!!|w:en}}
=> We are being zombified from the very beginning... Somebody, please... HELP!!!

Oldid from Commons

{{xoldid|1|||c}} => oldid 1 on c

See also

[edit]