Template:Site: Difference between revisions

From railML 2 Wiki
Jump to navigation Jump to search
[checked revision][checked revision]
(+ argument comment)
(railML→{{rml}})
 
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}] ''({{rml}} website{{#if:{{{type|}}}|,&nbsp;{{{type}}}}}{{#if:{{{lang|}}}|,&nbsp;{{{lang}}}}}{{#if:{{{comment|}}}|;&nbsp;{{{comment}}}}})''[[kategorie:External Link]]</includeonly><noinclude>
<includeonly>{{#switch:{{{mode}}}
|silent=[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}]
|#default=[{{{1}}} {{#if:{{{2|}}}|{{{2}}}|{{#if:{{{text|}}}|{{{text}}}|{{{1}}}}}}}]{{#ifeq:{{{inlang}}}|silent||&#32;''(}}{{#if:{{{inlang|}}}|{{#switch:{{{inlang}}}|silent=|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|}}}|,&nbsp;{{{date}}}}}{{#if:{{{type|}}}|,&nbsp;{{{type}}}}}{{#if:{{{lang|}}}|,&nbsp;{{lang|{{{lang}}}}}}}{{#if:{{{visited|}}}|,&nbsp;visited on {{{visited}}}}}{{#if:{{{comment|}}}|<nowiki>;</nowiki>&nbsp;{{{comment}}}}}{{#ifeq:{{{inlang}}}|silent||)''}}}}[[category:External Link]]</includeonly><noinclude>
==Usage==
==Usage==
Use this template, whenever you set links to the railml.org website ([http.://railml.org http.://railml.org]).
Use this template, whenever you set links to the railml.org website ({{external|https://railml.org|mode=silent}}).


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.
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]].
For Links to other websites, please use [[Template:External]].
{{note|An outline on Citations and References within the {{rml}} wikis can be found '''[[Dev:Wiki_Documentation_Guidelines#Citations_and_References|here]]'''.}}
=== Arguments ===
=== Arguments ===
The template has an obligatory and four optional argument:
The template has an obligatory and six optional argument:
*Obligatory; unnamed
*Obligatory; unnamed
**'''1''': the link target, e.g. http://railml.org
**'''1''': the link target, e.g. {{external|https://railml.org|mode=silent}}. '''Please, recognize [[#note|the note below]].'''
{{note|{{anchor|note}}If the content of the unnamed arguments contains equality signs this can easily result in errors.
;example
<nowiki>{{site|https://www.railml.org/forum/index.php?t=msg&goto=71&|Heidrun Jost BaliseGroup and its attributes {{rml}} forum post}}<nowiki />}}</nowiki><br>results in:<br>{{site|https://www.railml.org/forum/index.php?t=msg&goto=71&|Heidrun Jost BaliseGroup and its attributes {{rml}} forum post}}<nowiki />
 
There are two remedies:
*Either make the argument number explicit:<br><nowiki>{{site|1=https://www.railml.org/forum/index.php?t=msg&goto=71&|2=Heidrun Jost BaliseGroup and its attributes {{rml}} forum post}}</nowiki>
*Or escape all equality signs via {{wikipedia|url encoding}} in the first argument and with {{wikipedia|HTML entities}} in the second argument:<br><nowiki>{{site|https://www.railml.org/forum/index.php?t%3Dmsg&goto%3D71&|Heidrun Jost BaliseGroup and its attributes {{rml}} forum post}}</nowiki>|reminder}}
*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. '''Please, recognize [[#note|the note above]].'''
**''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
**''comment'': a comment to be displayed within the brackets
**''comment'': a comment to be displayed within the brackets
**''domain'': The domain of the site: e.g. ''schemas'' or ''forum''
**''inlang'': en (=default), de or fr for a notice in the language of the context (''inlang=silent'' suppresses the notice)
**''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 <<nowiki />ref> tags to show that this is on purpose not in a footnote.


If the second argument is unnamed (example: <nowiki>{{site|http://example.ex|some example text}}</nowiki>), it will be interpreted as link text. If the second argument is named (example:<nowiki>{{site|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>{{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 23: Line 40:
|'''Output'''
|'''Output'''
|-
|-
|<nowiki>{{site|http://railml.org}}</nowiki>
|<nowiki>{{site|https://railml.org}}</nowiki>
|[http://railml.org {{#if:|{{{2}}}|{{#if:|{{{text}}}|http://railml.org}}}}] ''({{rml}} website{{#if:|,&nbsp;{{{type}}}}}{{#if:|,&nbsp;{{{lang}}}}})''
|{{site|https://railml.org}}
|-
|<nowiki>{{site|https://railml.org|inlang=silent}}</nowiki>
|{{site|https://railml.org|inlang=silent}}
|-
|-
|<nowiki>{{site|http://railml.org|Our homepage}}</nowiki>
|<nowiki>{{site|https://railml.org|Our homepage}}</nowiki>
|[http://railml.org {{#if:Our homepage|Our homepage|{{#if:|{{{text}}}|http://railml.org}}}}] ''({{rml}} website{{#if:|,&nbsp;{{{type}}}}}{{#if:|,&nbsp;{{{lang}}}}})''
|{{site|https://railml.org|Our homepage}}
|-
|-
|<nowiki>{{site|http://railml.org|type=HTML}}</nowiki>
|<nowiki>{{site|https://railml.org|type=HTML}}</nowiki>
|[http://railml.org {{#if:|{{{2}}}|{{#if:|{{{text}}}|http://railml.org}}}}] ''({{rml}} website{{#if:HTML|,&nbsp;HTML}}{{#if:|,&nbsp;{{{lang}}}}})''
|{{site|https://railml.org|type=HTML}}
|-
|-
|<nowiki>{{site|http://railml.org|lang=EN|text=Our homepage}}</nowiki>
|<nowiki>{{site|https://railml.org|lang=EN|text=Our homepage}}</nowiki>
|[http://railml.org {{#if:|{{{2}}}|{{#if:Our homepage|Our homepage|http://railml.org}}}}] ''({{rml}} website{{#if:|,&nbsp;{{{type}}}}}{{#if:EN|,&nbsp;EN}})''
|{{site|https://railml.org|lang=EN|text=Our homepage}}
|-
|-
|<nowiki>{{site|http://railml.org|Our homepage|type=HTML|lang=EN}}</nowiki>
|<nowiki>{{site|https://railml.org|Our homepage|type=HTML|lang=EN}}</nowiki>
|[http://railml.org {{#if:Our homepage|Our homepage|{{#if:|{{{text}}}|http://railml.org}}}}] ''({{rml}} website{{#if:HTML|,&nbsp;HTML}}{{#if:EN|,&nbsp;EN}})''
|{{site|https://railml.org|Our homepage|type=HTML|lang=EN}}
|-
|-
|<nowiki>{{site|http://de.wiki.railvivid.railml.org|type=HTML|lang=DE|comment=In Development}}</nowiki>
|<nowiki>{{site|https://de.wiki.railvivid.railml.org|type=HTML|lang=DE|comment=In Development}}</nowiki>
|{{site|http://de.wiki.railvivid.railml.org|type=HTML|lang=DE|comment=In Development}}
|{{site|https://de.wiki.railvivid.railml.org|type=HTML|lang=DE|comment=In Development}}
|}
|}


[[kategorie:ContentTemplate]]
[[category:LinkTemplate]]{{interwiki}}
</noinclude>
</noinclude>

Latest revision as of 22:17, 22 January 2024

Usage

Use this template, whenever you set links to the railml.org website (https://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.

🗒️ An outline on Citations and References within the railML® wikis can be found here.

Arguments

The template has an obligatory and six optional argument:

💡 If the content of the unnamed arguments contains equality signs this can easily result in errors.
example

{{site|https://www.railml.org/forum/index.php?t=msg&goto=71&|Heidrun Jost BaliseGroup and its attributes {{rml}} forum post}}<nowiki />}}
results in:
[Heidrun Jost BaliseGroup and its attributes railML® forum post Heidrun Jost BaliseGroup and its attributes railML® forum post] (link to the railML® website)

There are two remedies:

  • Either make the argument number explicit:
    {{site|1=https://www.railml.org/forum/index.php?t=msg&goto=71&|2=Heidrun Jost BaliseGroup and its attributes {{rml}} forum post}}
  • Or escape all equality signs via url encoding (Wiki banner.png) in the first argument and with HTML entities (Wiki banner.png) in the second argument:
    {{site|https://www.railml.org/forum/index.php?t%3Dmsg&goto%3D71&|Heidrun Jost BaliseGroup and its attributes {{rml}} forum post}}
  • 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.
    • 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: e.g. schemas or forum
    • inlang: en (=default), de or fr for a notice in the language of the context (inlang=silent suppresses the notice)
    • 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: {{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 (link to the railML® website)
{{site|https://railml.org|inlang=silent}} https://railml.org
{{site|https://railml.org|Our homepage}} Our homepage (link to the railML® website)
{{site|https://railml.org|type=HTML}} https://railml.org (link to the railML® website, HTML)
{{site|https://railml.org|lang=EN|text=Our homepage}} Our homepage (link to the railML® website, 🇬🇧)
{{site|https://railml.org|Our homepage|type=HTML|lang=EN}} Our homepage (link to the railML® website, HTML, 🇬🇧)
{{site|https://de.wiki.railvivid.railml.org|type=HTML|lang=DE|comment=In Development}} https://de.wiki.railvivid.railml.org (link to the railML® website, HTML, 🇩🇪; In Development)