Template:External: Difference between revisions
[unchecked revision] | [checked revision] |
No edit summary |
|||
Line 8: | Line 8: | ||
|https://www.w3.org | |https://www.w3.org | ||
|https://www.w3.or=[{{#var:link}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}]{{#if:{{{date|}}}| ''(|{{#if:{{{type|}}}| ''(|{{#if:{{{lang|}}}| ''(|{{#if:{{{visited|}}}| ''(|{{#if:{{{comment|}}}| ''(}}}}}}}}}}{{#sub:{{#if:{{{date|}}}|, {{{date}}}}}{{#if:{{{type|}}}|, {{{type}}}}}{{#if:{{{lang|}}}|, {{lang|{{{lang}}}}}}}{{#if:{{{size|}}}|, size: {{{size}}}}}{{#if:{{{visited|}}}|, visited on {{{visited}}}}}{{#if:{{{comment|}}}|, {{{comment}}}}}|7}}{{#if:{{{date|}}}|)''|{{#if:{{{type|}}}|)''|{{#if:{{{lang|}}}|)''|{{#if:{{{visited|}}}|)''|{{#if:{{{comment|}}}|)''}}}}}}}}}} | |https://www.w3.or=[{{#var:link}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}]{{#if:{{{date|}}}| ''(|{{#if:{{{type|}}}| ''(|{{#if:{{{lang|}}}| ''(|{{#if:{{{visited|}}}| ''(|{{#if:{{{comment|}}}| ''(}}}}}}}}}}{{#sub:{{#if:{{{date|}}}|, {{{date}}}}}{{#if:{{{type|}}}|, {{{type}}}}}{{#if:{{{lang|}}}|, {{lang|{{{lang}}}}}}}{{#if:{{{size|}}}|, size: {{{size}}}}}{{#if:{{{visited|}}}|, visited on {{{visited}}}}}{{#if:{{{comment|}}}|, {{{comment}}}}}|7}}{{#if:{{{date|}}}|)''|{{#if:{{{type|}}}|)''|{{#if:{{{lang|}}}|)''|{{#if:{{{visited|}}}|)''|{{#if:{{{comment|}}}|)''}}}}}}}}}} | ||
|#default=[{{#var:link}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''({{#if:{{{inlang|}}}|{{#switch:{{{inlang}}}|de=externer {{#if:{{{archive}}}|Archiv-}}Link|fr=lien externe|#default=external {{#if:{{{archive}}}|archive }}link}}|external {{#if:{{{archive}}}|archive }}link}}{{#if:{{{date|}}}|, {{{date}}}}}{{#if:{{{type|}}}|, {{{type}}}}}{{#if:{{{lang|}}}|, {{lang|{{{lang}}}}}}}{{#if:{{{size|}}}|, size: {{{size}}}}}{{#if:{{{visited|}}}|, visited on {{{visited}}}}}{{#if:{{{comment|}}}|<nowiki>;</nowiki> {{{comment}}}}})''}}}}[[category:External Link]]</includeonly><noinclude> | |#default=[{{#var:link}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''({{#if:{{{inlang|}}}|{{#switch:{{{inlang}}}|de=externer {{#if:{{{archive|}}}|Archiv-}}Link|fr=lien externe|#default=external {{#if:{{{archive|}}}|archive }}link}}|external {{#if:{{{archive|}}}|archive }}link}}{{#if:{{{date|}}}|, {{{date}}}}}{{#if:{{{type|}}}|, {{{type}}}}}{{#if:{{{lang|}}}|, {{lang|{{{lang}}}}}}}{{#if:{{{size|}}}|, size: {{{size}}}}}{{#if:{{{visited|}}}|, visited on {{{visited}}}}}{{#if:{{{comment|}}}|<nowiki>;</nowiki> {{{comment}}}}})''}}}}[[category:External Link]]</includeonly><noinclude> | ||
==Usage== | ==Usage== | ||
The template can be used to mark external links. | The template can be used to mark external links. |
Revision as of 17:30, 20 November 2023
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 (https://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.
|
Dependencies
|
Arguments
The template has an obligatory and five optional argument:
- Obligatory; unnamed
- 1: the link target, e.g. https://uic.org. Please, recognize the note below.
|
- 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. Please, recognize the note above.
- archive: Provide an archive link in case the source is no longer available. On default, the original URL (argument 1) be displayed and the archive URL will be linked.
- 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. For EN, FR, DE, NL, NO, CZ and ES a flag will be displayed. In all other cases the input string will be returned.
- size: the file size — use only for very big files beyond 25 M!
- 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
- mode: if mode=silent, the link will not be commented.
- inline: dummyargument. Set inline=1 whenever you employ the template outside <ref> tags to show that this is on purpose not in a footnote.
If the second argument is unnamed (example: {{external|https://example.ex|some example text}}), it will be interpreted as link text. If the second argument is named (example:{{external|https://example.ex|type=some file format}}), it will be interpreted according to the argument name.
Examples
Code | Output |
{{external|https://www.uic.org}} | https://www.uic.org (external link) |
{{external|https://www.uic.org|International Union of Railways}} | International Union of Railways (external link) |
{{external|https://www.uic.org|type=HTML}} | https://www.uic.org (external link, HTML) |
{{external|https://www.uic.org|lang=EN|text=UIC}} | UIC (external link, 🇬🇧) |
{{external|https://www.uic.org|UIC|type=HTML|lang=EN}} | UIC (external link, HTML, 🇬🇧) |
{{external|https://www.w3.org/TR/xmlschema-2/#language}} | https://www.w3.org/TR/xmlschema-2/#language |
{{external|https://railml.org|mode=silent}} | https://railml.org |
{{external|https://railml.org|{{rml}} site|mode=silent}} | railML® site |
{{external|http://www.railml.org/en/index-en.shtml|archive=https://web.archive.org/web/20030527011905/http://www.railml.org/en/index-en.shtml}} | http://www.railml.org/en/index-en.shtml (external archive link) |