Link – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Fix template)
m (Text replacement - "{{Link|:Category:" to "{{Link|Category:")
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{link|{{{1|}}}}}}
<includeonly>{{#if:{{{link|{{{1|}}}}}}
| {{#if:{{#pos:{{{link|{{{1|}}}}}}|<nowiki/>://}}
| {{#if:{{#pos:{{{link|{{{1|}}}}}}|<nowiki/>://}}{{#pos:{{{link|{{{1|}}}}}}|mailto:}}
| {{ExternalLink|link= {{{link|{{{1}}}}}}|text= {{{text|{{{2|}}}}}}}}
| {{Link/External|link= {{{link|{{{1}}}}}}|text= {{{text|{{{2|}}}}}}}}
| {{#ifeq:{{#pos:{{Trim|{{{link|{{{1|}}}}}}}}|#}}|
| {{Link/Internal|link= {{{link|{{{1}}}}}}|text= {{{text|{{{2|}}}}}}}}
| [[{{{link|{{{1|}}}}}}{{#if:{{{text|{{{2|}}}}}}|{{!}}{{{link|{{{2}}}}}}}}]]
| {{HashLink|{{{link|{{{1}}}}}}|{{{text|{{{2|}}}}}}}}
}}
}}
}}
| -no link provided-{{TemplateCase||[[Category:Link template usage error]]}}
| -no link provided-{{TemplateCase||[[Category:Link template usage error]]}}
}}</includeonly><noinclude>{{Doc/Template
}}</includeonly><noinclude>{{Doc/Template


|descr= This template combines {{Template|ExternalLink}} and {{Template|HashLink}} under one entrypoint.
|descr= This template combines {{Template|Link/External}} and {{Template|Link/Internal}} under one entrypoint.
It also adds the page to the [[:Category:Link template usage error|Link template usage error]] category on usage error.
It also adds the page to the [[:Category:Link template usage error|Link template usage error]] category on usage error.


|param1= link
|param1= link
|descr1= (possibly named parameter) the URL or the local link, hashed or not ({{hl|Operation Flashpoint#Introduction}})
|descr1= (possibly named parameter) the URL or the local link, hashed or not ({{hl|Operation Flashpoint#Introduction}})
|param2= text
|param2= text
|descr2= (Optional, possibly named parameter) text to be displayed
|descr2= (Optional, possibly named parameter) text to be displayed
|example1= <nowiki>{{Link}}</nowiki>
|example1= <nowiki>{{Link}}</nowiki>
|result1= {{Link}}
|result1= {{Link}}
|example2= <nowiki>{{Link|http://}}</nowiki>
 
|result2= {{Link|http://}}
|example2= <nowiki/>
|example3= <nowiki>{{Link|link= http://ofp.gamepark.cz/index.php?showthis=2302}}</nowiki>
<nowiki>{{Link|http://}}</nowiki><br>
|result3= {{Link|link= http://ofp.gamepark.cz/index.php?showthis=2302}}
<nowiki>{{Link|https://}}</nowiki><br>
|example4= <nowiki>{{Link|setDir}}</nowiki>
<nowiki>{{Link|ftp://}}</nowiki><br>
|result4= {{Link|setDir}}
<nowiki>{{Link|enfusion://}}</nowiki><br>
|example5= <nowiki>{{Link|setDir#notes}}</nowiki>
<nowiki>{{Link|mailto:}}</nowiki>
|result5= {{Link|setDir#notes}}
|result2= <nowiki/>
|example6= <nowiki>{{Link|setDir#notes|setDir and nothing else}}</nowiki>
{{Link|http://}}<br>
|result6= {{Link|setDir#notes|setDir and nothing else}}
{{Link|https://}}<br>
|example7= <nowiki>{{Link|Arma Reforger:Getting Started}}</nowiki>
{{Link|ftp://}}<br>
|result7= {{Link|Arma Reforger:Getting Started}}
{{Link|enfusion://}}<br>
|example8= <nowiki>{{Link|Arma Reforger:Getting Started|Test}}</nowiki>
{{Link|mailto:}}
|result8= {{Link|Arma Reforger:Getting Started|Test}}
 
|example9= <nowiki>{{Link|Arma Reforger:Getting Started#Play in Single Player}}</nowiki>
|example3= <nowiki>{{Link|https://ofp.gamepark.cz/index.php?showthis{{=}}2302}}</nowiki><br><nowiki>{{Link|link= https://ofp.gamepark.cz/index.php?showthis=2302}}</nowiki><br><nowiki>{{Link|https://www.arma3.com/}}</nowiki><br><nowiki>{{Link|https://www.arma3.com/|{{arma3}} website}}</nowiki>
|result9= {{Link|Arma Reforger:Getting Started#Play in Single Player}}
|result3= {{Link|https://ofp.gamepark.cz/index.php?showthis{{=}}2302}}<br>{{Link|link= https://ofp.gamepark.cz/index.php?showthis=2302}}<br>{{Link|https://www.arma3.com/}}<br>{{Link|https://www.arma3.com/|{{arma3}} website}}
|example10= <nowiki>{{Link|Arma Reforger:Getting Started#Play in Single Player|Play in Single Player}}</nowiki>
 
|result10= {{Link|Arma Reforger:Getting Started#Play in Single Player|Play in Single Player}}
|example4= <nowiki/>
<nowiki>{{Link|setDir}}</nowiki><br>
<nowiki>{{Link|setDir#notes}}</nowiki><br>
<nowiki>{{Link|setDir#notes|setDir and nothing else}}</nowiki>
|result4= {{Link|setDir}}<br>{{Link|setDir#notes}}<br>{{Link|setDir#notes|setDir and nothing else}}
 
|example5= <nowiki/>
<nowiki>{{Link|#}}</nowiki><br>
<nowiki>{{Link|#Usage}}</nowiki><br>
<nowiki>{{Link|#Usage|The Usage chapter}}</nowiki><br>
<nowiki>{{Link|link= #Usage|text=}}</nowiki><br>
<nowiki>{{Link|link= #Usage|text= The Usage chapter}}</nowiki>
|result5= {{Link|#}}<br>{{Link|#Usage}}<br>{{Link|#Usage|The Usage chapter}}<br>{{Link|link= #Usage|text=}}<br>{{Link|link= #Usage|text= The Usage chapter}}
 
|example6= <nowiki/>
<nowiki>{{Link|Arma Reforger:Getting Started}}</nowiki><br>
<nowiki>{{Link|Arma Reforger:Getting Started|Test}}</nowiki><br>
<nowiki>{{Link|Arma Reforger:Getting Started#Play in Single Player}}</nowiki><br>
<nowiki>{{Link|Arma Reforger:Getting Started#Play in Single Player|Play in Single Player}}</nowiki>
|result6= {{Link|Arma Reforger:Getting Started}}<br>{{Link|Arma Reforger:Getting Started|Test}}<br>{{Link|Arma Reforger:Getting Started#Play in Single Player}}<br>{{Link|Arma Reforger:Getting Started#Play in Single Player|Play in Single Player}}
 
|example7= <nowiki/>
<nowiki>{{Link|setDir}}</nowiki><br>
<nowiki>{{Link|Arma Reforger:Getting Started}}</nowiki><br>
<nowiki>{{Link|Template:Messagebox}}</nowiki><br>
<nowiki>{{Link|Template:Messagebox|Messagebox Template}}</nowiki><br>
<nowiki>{{Link|Template:Messagebox#Usage}}</nowiki><br>
<nowiki>{{Link|Template:Messagebox#Usage|Messagebox template usage}}</nowiki><br>
<nowiki>{{Link|mailto:support@example.com|support e-mail}}</nowiki>
|result7= {{Link|setDir}}<br>{{Link|Arma Reforger:Getting Started}}<br>{{Link|Template:Messagebox}}<br>{{Link|Template:Messagebox|Messagebox Template}}<br>{{Link|Template:Messagebox#Usage}}<br>{{Link|Template:Messagebox#Usage|Messagebox template usage}}<br>{{Link|mailto:support@example.com|support e-mail}}
 
|example8= <nowiki>* {{Link|Category:Arma 3}}</nowiki><br><nowiki>* {{Link|Category:Arma 3}}</nowiki><br><nowiki>* {{Link|link= Category:Arma 3}}</nowiki><br><nowiki>* {{Link|link= :Category:Arma 3}}</nowiki><br><nowiki>* {{Link|link= Category:Arma 3 |text=}}</nowiki><br><nowiki>* {{Link|link= :Category:Arma 3 |text=}}</nowiki><br><nowiki>* {{Link|link= Category:Arma 3 |text= A3's category}}</nowiki><br><nowiki>* {{Link|link= :Category:Arma 3 |text= A3's category}}</nowiki>
|result8= <nowiki/>
* {{Link|Category:Arma 3}}
* {{Link|Category:Arma 3}}
* {{Link|link= Category:Arma 3}}
* {{Link|link= :Category:Arma 3}}
* {{Link|link= Category:Arma 3 |text=}}
* {{Link|link= :Category:Arma 3 |text=}}
* {{Link|link= Category:Arma 3 |text= A3's category}}
* {{Link|link= :Category:Arma 3 |text= A3's category}}
}}</noinclude>
}}</noinclude>

Latest revision as of 14:52, 16 October 2024

This template combines {{Link/External}} and {{Link/Internal}} under one entrypoint. It also adds the page to the Link template usage error category on usage error.

This template is used on these pages.

Usage

{{Link|link|text}}

  • link: (possibly named parameter) the URL or the local link, hashed or not (Operation Flashpoint#Introduction)
  • text: (Optional, possibly named parameter) text to be displayed
Examples
Code Result
{{Link}} -no link provided-

{{Link|http://}}
{{Link|https://}}
{{Link|ftp://}}
{{Link|enfusion://}}
{{Link|mailto:}}

http://
https://
ftp://
[enfusion:// ]
mailto:

{{Link|https://ofp.gamepark.cz/index.php?showthis{{=}}2302}}
{{Link|link= https://ofp.gamepark.cz/index.php?showthis=2302}}
{{Link|https://www.arma3.com/}}
{{Link|https://www.arma3.com/|{{arma3}} website}}
ofpr.info link link courtesy of
OFP-Faguss.com

ofpr.info link link courtesy of
OFP-Faguss.com

[1]
Arma 3 website

{{Link|setDir}}
{{Link|setDir#notes}}
{{Link|setDir#notes|setDir and nothing else}}

setDir
setDir - notes
setDir and nothing else

{{Link|#}}
{{Link|#Usage}}
{{Link|#Usage|The Usage chapter}}
{{Link|link= #Usage|text=}}
{{Link|link= #Usage|text= The Usage chapter}}

[[#|]]
Usage
The Usage chapter
Usage
The Usage chapter

{{Link|Arma Reforger:Getting Started}}
{{Link|Arma Reforger:Getting Started|Test}}
{{Link|Arma Reforger:Getting Started#Play in Single Player}}
{{Link|Arma Reforger:Getting Started#Play in Single Player|Play in Single Player}}

Arma Reforger:Getting Started
Test
Arma Reforger:Getting Started - Play in Single Player
Play in Single Player

{{Link|setDir}}
{{Link|Arma Reforger:Getting Started}}
{{Link|Template:Messagebox}}
{{Link|Template:Messagebox|Messagebox Template}}
{{Link|Template:Messagebox#Usage}}
{{Link|Template:Messagebox#Usage|Messagebox template usage}}
{{Link|mailto:support@example.com|support e-mail}}

setDir
Arma Reforger:Getting Started
Messagebox
Messagebox Template
Messagebox - Usage
Messagebox template usage
support e-mail
* {{Link|Category:Arma 3}}
* {{Link|Category:Arma 3}}
* {{Link|link= Category:Arma 3}}
* {{Link|link= :Category:Arma 3}}
* {{Link|link= Category:Arma 3 |text=}}
* {{Link|link= :Category:Arma 3 |text=}}
* {{Link|link= Category:Arma 3 |text= A3's category}}
* {{Link|link= :Category:Arma 3 |text= A3's category}}