Template:Wikipedia: Difference between revisions

Jump to navigation Jump to search
When linking to a diff a permalink and a link to a diff will be shown instead of a regular link and a permalink; Icon no longer link to the page
(Commenting the conditionals in the source; Adding parameters for alternative link text and for showing a diff to a previous revision; Slightly more elaborate examples)
(When linking to a diff a permalink and a link to a diff will be shown instead of a regular link and a permalink; Icon no longer link to the page)
Line 1: Line 1:
<span class="plainlinks">[http://{{{lang|en}}}.wikipedia.org/wiki/{{urlencode:{{{1|Main Page}}}|wiki}} <!--
<span class="plainlinks">[http://{{{lang|en}}}.wikipedia.org/<!--
-->{{#if: {{{diff|}}}  <!-- Is there a diff parameter and a permalink should be used? -->
|  <!-- Yes there is a diff parameter, use permalink -->
w/index.php?title={{urlencode:{{{1|Main Page}}}|wiki}}&oldid={{{oldid|}}}
|  <!-- No there is no diff parameter, use regular link -->
wiki/{{urlencode:{{{1|Main Page}}}|wiki}}
}} <!--
-->{{#if: {{{2|}}}  <!-- Is there an alternative text? -->
-->{{#if: {{{2|}}}  <!-- Is there an alternative text? -->
  |  <!-- Yes, there is an alternative text -->
  |  <!-- Yes, there is an alternative text -->
Line 8: Line 14:
-->{{#if: {{{oldid|}}}  <!-- Is there an oldid parameter? -->
-->{{#if: {{{oldid|}}}  <!-- Is there an oldid parameter? -->
  |  <!-- Yes there is an oldid parameter -->
  |  <!-- Yes there is an oldid parameter -->
  {{#if: {{{diff|}}}  <!-- Is there also a non-empty diff parameter? -->
  (<span class="plainlinks">[http://{{{lang|en}}}.wikipedia.org/w/index.php?title={{urlencode:{{{1|Main Page}}}|wiki}}<!--
   |  <!-- Yes, there there also a non-empty diff parameter -->
-->{{#if: {{{diff|}}}  <!-- Is there also a non-empty diff parameter? -->
   (<span class="plainlinks">[http://{{{lang|en}}}.wikipedia.org/w/index.php?title={{urlencode:{{{1|Main Page}}}|wiki}}&diff=prev&oldid={{{oldid}}} diff]</span>)
   |  <!-- Yes, there there also a non-empty diff parameter, show a link to the diff -->
   |  <!-- No, there no diff parameter -->
   &diff=prev&oldid={{{oldid|}}} diff
   (<span class="plainlinks">[http://{{{lang|en}}}.wikipedia.org/w/index.php?title={{urlencode:{{{1|Main Page}}}|wiki}}&oldid={{{oldid}}} permalink]</span>)
   |  <!-- No, there no diff parameter, show prmalink -->
}}
   &oldid={{{oldid|}}} permalink
}} [[File:Wikipedia icon 32px.png|15px|alt="Wikipedia article"|link=http://{{{lang|en}}}.wikipedia.org/wiki/{{urlencode:{{{1|Main Page}}}|wiki}}]]<noinclude>
}}<!--
-->]</span>)
}} [[File:Wikipedia icon 32px.png|15px|alt="Wikipedia article"|title="Wikipedia article"]]<noinclude>
{{Informative template|1=
{{Informative template|1=
__NOTOC__
__NOTOC__
Line 34: Line 42:
; oldid:            Oldid from the end of the Wikipedia permalink URL to use when linking to a specific article revision.  Can be found through the page history.
; oldid:            Oldid from the end of the Wikipedia permalink URL to use when linking to a specific article revision.  Can be found through the page history.


; diff:              If not empty a link to a diff comparing the oldid revision with the previous revision will be shown.
; diff:              If not empty a link to a diff comparing the oldid revision with the previous revision will be shown.  Instead of a regular link and a permalink a permalink and a link to a diff will be shown.


== Examples ==
== Examples ==

Navigation menu