Template:External: Difference between revisions
[checked revision] | [checked revision] |
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch:{{#sub:{{{1}}}|0|17}} | <includeonly>{{#switch:{{#sub:{{{1}}}|0|17}} | ||
|http://www.w3.org | |http://www.w3.org | ||
|https://www.w3.or=[{{{1}}} | |https://www.w3.or=[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] | ||
{{#if:{{{text|}}}|''(''|{{{1}}}|{{#if:{{{date|}}}|''(''|{{#if:{{{type|}}}|''(''|{{#if:{{{lang|}}}|''(''|{{#if:{{{visited|}}}|''(''|{{#if:{{{comment|}}}|''(''}}}}}}}}}}}} | {{#if:{{{text|}}}|''(''|{{{1}}}|{{#if:{{{date|}}}|''(''|{{#if:{{{type|}}}|''(''|{{#if:{{{lang|}}}|''(''|{{#if:{{{visited|}}}|''(''|{{#if:{{{comment|}}}|''(''}}}}}}}}}}}} | ||
{{#if:{{{date|}}}|, ''{{{date}}}''}}{{#if:{{{type|}}}|, ''{{{type}}}''}}{{#if:{{{lang|}}}|, ''{{{lang}}}''}}{{#if:{{{visited|}}}|, ''visited on {{{visited}}}''}}{{#if:{{{comment|}}}|<nowiki>;</nowiki> ''{{{comment}}}''}} | |||
|#default=[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''({{#if:{{{inlang|}}}|{{#switch:{{{inlang}}}|de=externer Link|fr=lien externe|#default=external link}}|external link}}{{#if:{{{date|}}}|, {{{date}}}}}{{#if:{{{type|}}}|, {{{type}}}}}{{#if:{{{lang|}}}|, {{{lang}}}}}{{#if:{{{visited|}}}|, visited on {{{visited}}}}}{{#if:{{{comment|}}}|<nowiki>;</nowiki> {{{comment}}}}})''}}[[category:External Link]]</includeonly><noinclude> | |#default=[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''({{#if:{{{inlang|}}}|{{#switch:{{{inlang}}}|de=externer Link|fr=lien externe|#default=external link}}|external link}}{{#if:{{{date|}}}|, {{{date}}}}}{{#if:{{{type|}}}|, {{{type}}}}}{{#if:{{{lang|}}}|, {{{lang}}}}}{{#if:{{{visited|}}}|, visited on {{{visited}}}}}{{#if:{{{comment|}}}|<nowiki>;</nowiki> {{{comment}}}}})''}}[[category:External Link]]</includeonly><noinclude> | ||
==Usage== | ==Usage== |
Revision as of 18:14, 19 February 2018
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.
Please, consider, that the template contains an exception for links to the World Wide Web Consortium (W3C), as there are too many links to W3C data types — we want to avoid the reading flow being disturbed.
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 =.
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=msg&th=469&start=0&}} as to display http://www.railml.org/forum/index.php?t=msg&th=469&start=0& (external link)
- 1: the link target, e.g. http://uic.org
- 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
- inlang: en (=default), de or fr for a notice in the language of the context
- comment: anything that does not fit into the other parameters; a string to be displayed directly
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) |
{{external|https://www.w3.org/TR/xmlschema-2/#language}} | https://www.w3.org/TR/xmlschema-2/#language |