Template:Wikipedia: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(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 ==

Revision as of 11:27, 7 June 2014

Main Page title="Wikipedia article"

The following template description is not displayed when the template is inserted in an article.

Goal

This template can be used for links to Wikipedia pages.

Usage

{{wikipedia|page title|alternative text|lang=|oldid=|diff=}}

All parameters are optional.

page title
Page title to link to. Defaults to Main Page.
alternative text
Alternative text to be shown instead of the page title.
lang
Two letter language code to link to another language version than the English one. The language will not be shown (currently not implemented), but the page title might give a hint.
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. Instead of a regular link and a permalink a permalink and a link to a diff will be shown.

Examples

See the {{wikipedia|FlightGear}} article on Wikipedia.

See the FlightGear title="Wikipedia article" article on Wikipedia.

See the {{wikipedia|FlightGear|lang=sv}} article on the Swedish Wikipedia.

See the FlightGear title="Wikipedia article" article on Swedish Wikipedia.

The Wikipedia article by the time of the {{wikipedia|release of FlightGear 3.0|oldid=596124837}}.

The Wikipedia article by the time of the release of FlightGear 3.0 (permalink) title="Wikipedia article".

Someone {{wikipedia|FlightGear#History|mentioned the HondaJet take-down request|oldid=611503439|diff=yep}} on Wikipedia.

Someone mentioned the HondaJet take-down request (diff) title="Wikipedia article" on Wikipedia.

Related templates