Jump to content

Template:Diff/doc

From Wikibooks, open books for an open world

Displays the link for a diff. The first two numbered parameters are the ID numbers of the revisions (in either order). If only the first parameter is given, the diff is to the previous revision. If only the second is given, the diff is to the current revision. Thus:

  • {{diff|1952469|1952247}} yields the link [1] which expands on clicking to the
      url: https://en.wikibooks.org/wiki/?diff=1952469&oldid=1952247&diffonly=0
  • {{diff|1952247|1952469}} yields [2]
  • {{diff|1952469}} yields [3]
  • {{diff|1952469|}} yields [4]
  • {{diff||1952469}} yields [5]
  • {{diff}} yields [6]

Moreover, there's an optional named Boolean parameter, only, or you can use diffonly, which, if nonzero, makes the diff URL have diffonly set.

  • {{diff|1952469|1952247|only=1}} yields [7]
  • {{diff|1952469|1952247|diffonly=1}} yields [8]
  • {{diff|1952247|1952469|only=}} yields [9]

The third, or text, parameter, yields the text to be displayed:

  • {{diff|1952469|1952247|this diff}} yields diff
  • {{diff|1952469|1952247|text=some text}} yields [10]