Link – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Template creation)
 
(Fix template)
Line 3: Line 3:
| {{ExternalLink|link= {{{link|{{{1}}}}}}|text= {{{text|{{{2|}}}}}}}}
| {{ExternalLink|link= {{{link|{{{1}}}}}}|text= {{{text|{{{2|}}}}}}}}
| {{#ifeq:{{#pos:{{Trim|{{{link|{{{1|}}}}}}}}|#}}|
| {{#ifeq:{{#pos:{{Trim|{{{link|{{{1|}}}}}}}}|#}}|
| [[{{{link|{{{1|}}}}}}{{#if:{{{text|{{{2|}}}}}}{{!}}{{{link|{{{2}}}}}}}}]]
| [[{{{link|{{{1|}}}}}}{{#if:{{{text|{{{2|}}}}}}|{{!}}{{{link|{{{2}}}}}}}}]]
| {{HashLink|{{{link|{{{1}}}}}}|{{{text|{{{2|}}}}}}}}
| {{HashLink|{{{link|{{{1}}}}}}|{{{text|{{{2|}}}}}}}}
}}
}}
Line 29: Line 29:
|example6= <nowiki>{{Link|setDir#notes|setDir and nothing else}}</nowiki>
|example6= <nowiki>{{Link|setDir#notes|setDir and nothing else}}</nowiki>
|result6= {{Link|setDir#notes|setDir and nothing else}}
|result6= {{Link|setDir#notes|setDir and nothing else}}
|example7= <nowiki>{{Link|Arma Reforger:Getting Started}}</nowiki>
|result7= {{Link|Arma Reforger:Getting Started}}
|example8= <nowiki>{{Link|Arma Reforger:Getting Started|Test}}</nowiki>
|result8= {{Link|Arma Reforger:Getting Started|Test}}
|example9= <nowiki>{{Link|Arma Reforger:Getting Started#Play in Single Player}}</nowiki>
|result9= {{Link|Arma Reforger:Getting Started#Play in Single Player}}
|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}}
}}</noinclude>
}}</noinclude>

Revision as of 17:42, 15 December 2022

This template combines {{ExternalLink}} and {{HashLink}} 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://}} http://
{{Link|link= http://ofp.gamepark.cz/index.php?showthis=2302}} ofpr.info link link courtesy of
OFP-Faguss.com
{{Link|setDir}} setDir
{{Link|setDir#notes}} setDir - notes
{{Link|setDir#notes|setDir and nothing else}} setDir and nothing else
{{Link|Arma Reforger:Getting Started}} Arma Reforger:Getting Started
{{Link|Arma Reforger:Getting Started|Test}} Test
{{Link|Arma Reforger:Getting Started#Play in Single Player}} Arma Reforger:Getting Started - Play in Single Player
{{Link|Arma Reforger:Getting Started#Play in Single Player|Play in Single Player}} Play in Single Player