Template:External: Difference between revisions

From railML 2 Wiki
Jump to navigation Jump to search
[checked revision][checked revision]
(note)
(parameters date & visited added)
Line 1: Line 1:
<includeonly>[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''(external link{{#if:{{{type|}}}|,&nbsp;{{{type}}}}}{{#if:{{{lang|}}}|,&nbsp;{{{lang}}}}})''[[category:External Link]]</includeonly><noinclude>
<includeonly>[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''(external link{{#if:{{{date|}}}|,&nbsp;{{{date}}}}}{{#if:{{{type|}}}|,&nbsp;{{{type}}}}}{{#if:{{{lang|}}}|,&nbsp;{{{lang}}}}}{{#if:{{{visited|}}}|,&nbsp;visited on {{{visited}}}}})''[[category:External Link]]</includeonly><noinclude>
==Usage==
==Usage==
{{note|It is agreed that the usage of this template should expire. Enter external links directly into the text acoording to [https://www.mediawiki.org/wiki/Help:Links#External_links the mediawiki documentation]. Replace the template, whereever you encounter it.}}
The template can be used to mark external links.
The template can be used to mark external links.


Line 9: Line 7:
For Links to pages on the {{rml}}-site ([http://railml.org http://railml.org]), please use [[Template:Site]].
For Links to pages on the {{rml}}-site ([http://railml.org http://railml.org]), please use [[Template:Site]].
===Arguments===
===Arguments===
The template has an obligatory and three optional argument:
The template has an obligatory and five optional argument:
*Obligatory; unnamed
*Obligatory; unnamed
**'''1''': the link target, e.g. http://uic.org<br>'''Notice:''' the mediawiki software will misinterpret URLs containing the equality sign (=). Replace equality signs in URLs with the HTML-entity &amp;#61;.<br>''Example:'' replace <nowiki>{{external|http://www.railml.org/forum/index.php?t=msg&th=469&start=0&}}</nowiki> with <nowiki>{{external|http://www.railml.org/forum/index.php?t&amp;#61;msg&th&amp;#61;469&start&amp;#61;0&}}</nowiki> as to display [http://www.railml.org/forum/index.php?t&#61;msg&th&#61;469&start&#61;0& http://www.railml.org/forum/index.php?t&#61;msg&th&#61;469&start&#61;0&] ''(external link)''
**'''1''': the link target, e.g. http://uic.org<br>'''Notice:''' the mediawiki software will misinterpret URLs containing the equality sign (=). Replace equality signs in URLs with the HTML-entity &amp;#61;.<br>''Example:'' replace <nowiki>{{external|http://www.railml.org/forum/index.php?t=msg&th=469&start=0&}}</nowiki> with <nowiki>{{external|http://www.railml.org/forum/index.php?t&amp;#61;msg&th&amp;#61;469&start&amp;#61;0&}}</nowiki> as to display [http://www.railml.org/forum/index.php?t&#61;msg&th&#61;469&start&#61;0& http://www.railml.org/forum/index.php?t&#61;msg&th&#61;469&start&#61;0&] ''(external link)''
*Optional
*Optional
**'''2''' or ''text'': the link text. If it is empty, the link target will be used as link text. This argument can be used both named or unnamed.
**'''2''' or ''text'': the link text. If it is empty, the link target will be used as link text. This argument can be used both named or unnamed.
**''date'': the publication date of the file
**''type'': the file type, e.g. PDF
**''type'': the file type, e.g. PDF
**''lang'': the language of the link target file, e.g. EN
**''lang'': the language of the link target file, e.g. EN
**''visited'': the date when the file was visited


If the second argument is unnamed (example: <nowiki>{{external|http://example.ex|some example text}}</nowiki>), it will be interpreted as link text. If the second argument is named (example:<nowiki>{{external|http://example.ex|type=some file format}}</nowiki>), it will be interpreted according to the argument name.
If the second argument is unnamed (example: <nowiki>{{external|http://example.ex|some example text}}</nowiki>), it will be interpreted as link text. If the second argument is named (example:<nowiki>{{external|http://example.ex|type=some file format}}</nowiki>), it will be interpreted according to the argument name.

Revision as of 14:44, 2 November 2017

Usage

The template can be used to mark external links.

This template grants that external links will be collected in category:External Link. So we keep an overview of external links and control their actuality routinely.

For Links to pages on the railML®-site (http://railml.org), please use Template:Site.

Arguments

The template has an obligatory and five optional argument:

  • Obligatory; unnamed
    • 1: the link target, e.g. http://uic.org
      Notice: the mediawiki software will misinterpret URLs containing the equality sign (=). Replace equality signs in URLs with the HTML-entity &#61;.
      Example: replace {{external|http://www.railml.org/forum/index.php?t=msg&th=469&start=0&}} with {{external|http://www.railml.org/forum/index.php?t&#61;msg&th&#61;469&start&#61;0&}} as to display http://www.railml.org/forum/index.php?t=msg&th=469&start=0& (external link)
  • Optional
    • 2 or text: the link text. If it is empty, the link target will be used as link text. This argument can be used both named or unnamed.
    • date: the publication date of the file
    • type: the file type, e.g. PDF
    • lang: the language of the link target file, e.g. EN
    • visited: the date when the file was visited

If the second argument is unnamed (example: {{external|http://example.ex|some example text}}), it will be interpreted as link text. If the second argument is named (example:{{external|http://example.ex|type=some file format}}), it will be interpreted according to the argument name.

Examples

Code Output
{{external|http://www.uic.org}} http://www.uic.org (external link)
{{external|http://www.uic.org|International Union of Railways}} International Union of Railways (external link)
{{external|http://www.uic.org|type=HTML}} http://www.uic.org (external link, HTML)
{{external|http://www.uic.org|lang=EN|text=UIC}} UIC (external link, EN)
{{external|http://www.uic.org|UIC|type=HTML|lang=EN}} UIC (external link, HTML, EN)