Template:Undo: Difference between revisions
m (1 revision) |
(No difference)
|
Latest revision as of 15:59, 25 January 2014
This template is intended to be useful for creating links to "undo" diffs. Note: not all revisions can be undone. Use this template with care.
Every version of a page has a revision ID, which you can find from the history of the page by looking at the link for the timestamp, which is of the form:
http[s]://en.wikipedia.org/w/index.php?title=SomePageName&oldid=442212827
The number after oldid= is the revision ID.
Given a page name and two revision IDs, you can construct links undo diffs.
Usage
{{Undo|page|oldid|diff|label}}
- page – The title of the page.
- oldid – The base ID onto which the diff is generated.
- diff – The ID or keyword that is used against the base ID.
- label – Text to display as link. No label will give an "undo" link.
Examples
{{Undo|Wikipedia:Pagediff|204934693|204901573}}
- undo
- The page= parameter (parameter number 1) should be a name of a page, for instance Wikipedia:Pagediff.
- The oldid= parameter (parameter number 2) should be the smaller revision number.
- The diff= parameter (parameter number 3) should be the larger revision number.
- undo
{{Undo|Wikipedia:Pagediff|204934693|204901573|revert an edit}}
- revert an edit
- The page= parameter (parameter number 1) should be a name of a page, for instance Wikipedia:Pagediff.
- The oldid= parameter (parameter number 2) should be the smaller revision number.
- The diff= parameter (parameter number 3) should be the larger revision number.
- The label= parameter (parameter number 4) should be an alternate display for the link than just "undo"
- revert an edit
See also
- {{Oldid}} – simplifies the case for linking to a known old version
- {{Diff}}
- {{Diff2}}
- {{Querylink}} – generic template to construct query strings
- diff – syntax highlight on wiki pages with mw:Extension:SyntaxHighlight GeSHi
- User:Scottywong/diffconverter, a tool for converting from raw form
TemplateData
A template that is intended to be useful for creating links to undo specific diffs.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Page | page | The title of the page. | Page name | required |
Oldid | oldid | The base ID onto which the diff is generated. Some number like "442212827" (without the quotes). | Number | required |
Diff | diff | The ID or keyword that is used against the base ID. | Number | required |
Label | label | Text to display as link. No label will give a numbered link.
| Line | optional |
The above documentation is transcluded from Template:Undo/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |