Template:Site: Difference between revisions
Jump to navigation
Jump to search
[checked revision] | [unchecked revision] |
No edit summary |
|||
Line 1: | Line 1: | ||
<includeonly>[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''({{#if:{{{inlang|}}}|{{#switch:{{{inlang}}}|de=Link zur {{rml}}-Website|fr=Sorry — the french translation is missing. Help on [[template:site]] is welcome :)|#default=link to the {{rml}} website}}|link to the {{rml}} website}}{{#if:{{{date|}}}|, {{{date}}}}}{{#if:{{{type|}}}|, {{{type}}}}}{{#if:{{{lang|}}}|, {{{lang}}}}}{{#if:{{{visited|}}}|, visited on {{{visited}}}}}{{#if:{{{comment|}}}|<nowiki>;</nowiki> {{{comment}}}}})''[[category:External Link]]</includeonly><noinclude> | <includeonly>[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''({{#if:{{{inlang|}}}|{{#switch:{{{inlang}}}|de=Link zur {{rml}}-Website|fr=Sorry — the french translation is missing. Help on [[template:site]] is welcome :)|#default=link to the {{rml}} website}}|link to the {{rml}} website}}{{#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== | ||
Line 9: | Line 10: | ||
The template has an obligatory and six optional argument: | The template has an obligatory and six optional argument: | ||
*Obligatory; unnamed | *Obligatory; unnamed | ||
**'''1''': the link target, e.g. | **'''1''': the link target, e.g. https://railml.org<br>'''Notice:''' the mediawiki software will misinterpret URLs containing the equality sign (=). Replace equality signs in URLs with the HTML-entity &#61;.<br>''Example:'' replace <nowiki>{{site|https://www.railml.org/forum/index.php?t=msg&th=469&start=0&}}</nowiki> with <nowiki>{{site|https://www.railml.org/forum/index.php?t&#61;msg&th&#61;469&start&#61;0&}}</nowiki> as to display [https://www.railml.org/forum/index.php?t=msg&th=469&start=0& https://www.railml.org/forum/index.php?t=msg&th=469&start=0&] ''({{rml}} website)'' | ||
*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. | ||
Line 21: | Line 22: | ||
**''comment'': anything that does not fit into the other parameters; a string to be displayed directly | **''comment'': anything that does not fit into the other parameters; a string to be displayed directly | ||
If the second argument is unnamed (example: <nowiki>{{site| | If the second argument is unnamed (example: <nowiki>{{site|https://example.ex|some example text}}</nowiki>), it will be interpreted as link text. If the second argument is named (example:<nowiki>{{site|https://example.ex|type=some file format}}</nowiki>), it will be interpreted according to the argument name. | ||
==Examples== | ==Examples== | ||
Line 28: | Line 29: | ||
|'''Output''' | |'''Output''' | ||
|- | |- | ||
|<nowiki>{{site| | |<nowiki>{{site|https://railml.org}}</nowiki> | ||
|[ | |[https://railml.org {{#if:|{{{2}}}|{{#if:|{{{text}}}|https://railml.org}}}}] ''({{rml}} website{{#if:|, {{{type}}}}}{{#if:|, {{{lang}}}}})'' | ||
|- | |- | ||
|<nowiki>{{site| | |<nowiki>{{site|https://railml.org|Our homepage}}</nowiki> | ||
|[ | |[https://railml.org {{#if:Our homepage|Our homepage|{{#if:|{{{text}}}|https://railml.org}}}}] ''({{rml}} website{{#if:|, {{{type}}}}}{{#if:|, {{{lang}}}}})'' | ||
|- | |- | ||
|<nowiki>{{site| | |<nowiki>{{site|https://railml.org|type=HTML}}</nowiki> | ||
|[ | |[https://railml.org {{#if:|{{{2}}}|{{#if:|{{{text}}}|https://railml.org}}}}] ''({{rml}} website{{#if:HTML|, HTML}}{{#if:|, {{{lang}}}}})'' | ||
|- | |- | ||
|<nowiki>{{site| | |<nowiki>{{site|https://railml.org|lang=EN|text=Our homepage}}</nowiki> | ||
|[ | |[https://railml.org {{#if:|{{{2}}}|{{#if:Our homepage|Our homepage|https://railml.org}}}}] ''({{rml}} website{{#if:|, {{{type}}}}}{{#if:EN|, EN}})'' | ||
|- | |- | ||
|<nowiki>{{site| | |<nowiki>{{site|https://railml.org|Our homepage|type=HTML|lang=EN}}</nowiki> | ||
|[ | |[https://railml.org {{#if:Our homepage|Our homepage|{{#if:|{{{text}}}|https://railml.org}}}}] ''({{rml}} website{{#if:HTML|, HTML}}{{#if:EN|, EN}})'' | ||
|- | |- | ||
|<nowiki>{{site| | |<nowiki>{{site|https://de.wiki.railvivid.railml.org|type=HTML|lang=DE|comment=In Development}}</nowiki> | ||
|[ | |[https://de.wiki.railvivid.railml.org {{#if:|{{{2}}}|{{#if:|{{{text}}}|https://de.wiki.railvivid.railml.org}}}}] ''({{rml}} website{{#if:HTML|, HTML}}{{#if:DE|, DE}}{{#if:In Development|<nowiki>;</nowiki> In Development}})'' | ||
|} | |} | ||
[[category:LinkTemplate]] | [[category:LinkTemplate]] | ||
</noinclude> | </noinclude> |
Revision as of 17:14, 15 February 2021
Usage
Use this template, whenever you set links to the railml.org website ([http.://railml.org http.://railml.org]).
This template grants that links out of this wiki will be collected in category:External Link. So we keep an overview of external links and control their actuality routinely.
For Links to other websites, please use Template:External.
Arguments
The template has an obligatory and six optional argument:
- Obligatory; unnamed
- 1: the link target, e.g. https://railml.org
Notice: the mediawiki software will misinterpret URLs containing the equality sign (=). Replace equality signs in URLs with the HTML-entity =.
Example: replace {{site|https://www.railml.org/forum/index.php?t=msg&th=469&start=0&}} with {{site|https://www.railml.org/forum/index.php?t=msg&th=469&start=0&}} as to display https://www.railml.org/forum/index.php?t=msg&th=469&start=0& (railML® website)
- 1: the link target, e.g. https://railml.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
- comment: a comment to be displayed within the brackets
- domain: The domain of the site: schemas, svn, trac or forum
- 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: {{site|https://example.ex|some example text}}), it will be interpreted as link text. If the second argument is named (example:{{site|https://example.ex|type=some file format}}), it will be interpreted according to the argument name.
Examples
Code | Output |
{{site|https://railml.org}} | https://railml.org (railML® website) |
{{site|https://railml.org|Our homepage}} | Our homepage (railML® website) |
{{site|https://railml.org|type=HTML}} | https://railml.org (railML® website, HTML) |
{{site|https://railml.org|lang=EN|text=Our homepage}} | Our homepage (railML® website, EN) |
{{site|https://railml.org|Our homepage|type=HTML|lang=EN}} | Our homepage (railML® website, HTML, EN) |
{{site|https://de.wiki.railvivid.railml.org|type=HTML|lang=DE|comment=In Development}} | https://de.wiki.railvivid.railml.org (railML® website, HTML, DE; In Development) |