Link/Hash – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Category:Templates" to "{{uc:{{PAGENAME}}}}")
m (HashLink → Link/Hash)
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
|[[{{{1}}}{{!}}{{#ifeq:{{#pos:{{Trim|{{{1}}}}}|#}}|0
| [[{{{1}}}{{!}}{{#if:{{{2|}}}
|{{#replace:{{#sub:{{Trim|{{{1}}}}}|1}}|_|<nowiki/> <nowiki/>}}
| {{{2}}}
|{{#replace:{{#explode:{{Trim|{{{1}}}}}|#|0|0}} - {{#explode:{{Trim|{{{1}}}}}|#|1}}|_|<nowiki/> <nowiki/>}}
| {{#ifeq:{{#pos:{{Trim|{{{1}}}}}|#}}|0
}}]]
| {{#replace:{{#sub:{{Trim|{{{1}}}}}|1}}|#|&#35;}}
|-no link specified-
| {{#replace:{{#replace:{{#explode:{{Trim|{{{1}}}}}|#|0|0|2}}|:Category:|}}|Arma Reforger:|}} - {{#explode:{{Trim|{{{1}}}}}|#|1|2}}
}}</includeonly><noinclude>
}}}}]]
Creates an auto-formatted hash link (e.g <tt>#value</tt> or <tt>page#anchor</tt>).
| -no link specified-
 
}}</includeonly><noinclude>{{Doc/Template
== Usage ==
|descr= Creates an auto-formatted hash link (e.g {{hl|#value}} or {{hl|page#anchor}}).
{{<nowiki/>HashLink|'''''haskLink'''''}}
|param1= hashLink
* hashLink: wiki hash link, e.g <tt>#toc</tt> or <tt>Arma 3#Key features</tt>
|descr1= wiki hash link, e.g {{hl|#toc}} or {{hl|Arma 3#Key features}}
 
|param2= text
{| class="wikitable"
|descr2= display text
|+ Examples
|example1= <nowiki>{{Link/Hash}}</nowiki>
! Code
|result1= {{Link/Hash}}
! Result
|example2= <nowiki>{{Link/Hash|setDir}}</nowiki>
|-
|result2= {{Link/Hash|setDir}}
| <nowiki>{{HashLink}}</nowiki>
|example3= <nowiki/>
| {{HashLink}}
<nowiki>{{Link/Hash|#toc}}</nowiki><br>
|-
<nowiki>{{Link/Hash|#Multipart Hashlink}}</nowiki>
| <nowiki>{{HashLink|#toc}}</nowiki>
|result3= {{Link/Hash|#toc}}<br>{{Link/Hash|#Multipart Hashlink}}
| {{HashLink|#toc}}
|example4= <nowiki>{{Link/Hash|#Multipart Hashlink|Display text}}</nowiki>
|-
|result4= {{Link/Hash|#Multipart Hashlink|Display text}}
| <nowiki>{{HashLink|#Multipart Hashlink}}</nowiki>
|example5= <nowiki>{{Link/Hash|Arma_3#Key_features}}</nowiki><br><nowiki>{{Link/Hash|Arma 3#Key features}}</nowiki>
| {{HashLink|#Multipart Hashlink}}
|result5= {{Link/Hash|Arma_3#Key_features}}<br>{{Link/Hash|Arma 3#Key features}}
|-
|example6= <nowiki>{{Link/Hash|Arma 3#Key features|A3's Key Features}}</nowiki>
| <nowiki>{{HashLink|Arma_3#Key_features}}</nowiki>
|result6= {{Link/Hash|Arma 3#Key features|A3's Key Features}}
| {{HashLink|Arma_3#Key_features}}
|example7= <nowiki/>
|-
<nowiki>.{{Link/Hash|Arma 3#Key features}}.</nowiki><br>
| <nowiki>{{HashLink|Arma 3#Key features}}</nowiki>
<nowiki>{{Link/Hash|##if}}</nowiki><br>
| {{HashLink|Arma 3#Key features}}
<nowiki>{{Link/Hash|##if#then##else}}</nowiki><br>
|-
<nowiki>{{Link/Hash|CT_LISTNBOX#BIS_fnc_initList example}}</nowiki><br>
| <nowiki>.{{HashLink|Arma 3#Key features}}.</nowiki>
<nowiki>{{Link/Hash|:Category:Community Tools#Code Edition}}</nowiki><br>
| .{{HashLink|Arma 3#Key features}}.
<nowiki>{{Link/Hash|Arma Reforger:Server Hosting#Dedicated Server}}</nowiki>
|}
|result7= <nowiki/>
 
.{{Link/Hash|Arma 3#Key features}}.<br>
[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude>
{{Link/Hash|##if}}<br>
{{Link/Hash|##if#then##else}}<br>
{{Link/Hash|PreProcessor Commands##if}}<br>
{{Link/Hash|CT_LISTNBOX#BIS_fnc_initList example}}<br>
{{Link/Hash|:Category:Community Tools#Code Edition}}<br>
{{Link/Hash|Arma Reforger:Server Hosting#Dedicated Server}}
}}</noinclude>

Revision as of 18:12, 4 January 2023

Creates an auto-formatted hash link (e.g #value or page#anchor).

This template is used on these pages.

Usage

{{Link/Hash|hashLink|text}}

  • hashLink: wiki hash link, e.g #toc or Arma 3#Key features
  • text: display text
Examples
Code Result
{{Link/Hash}} -no link specified-
{{Link/Hash|setDir}} setDir -

{{Link/Hash|#toc}}
{{Link/Hash|#Multipart Hashlink}}

toc
Multipart Hashlink
{{Link/Hash|#Multipart Hashlink|Display text}} Display text
{{Link/Hash|Arma_3#Key_features}}
{{Link/Hash|Arma 3#Key features}}
Arma_3 - Key_features
Arma 3 - Key features
{{Link/Hash|Arma 3#Key features|A3's Key Features}} A3's Key Features

.{{Link/Hash|Arma 3#Key features}}.
{{Link/Hash|##if}}
{{Link/Hash|##if#then##else}}
{{Link/Hash|CT_LISTNBOX#BIS_fnc_initList example}}
{{Link/Hash|:Category:Community Tools#Code Edition}}
{{Link/Hash|Arma Reforger:Server Hosting#Dedicated Server}}

.Arma 3 - Key features.
#if
#if#then##else
PreProcessor Commands - #if
CT_LISTNBOX - BIS_fnc_initList example
Community Tools - Code Edition
Server Hosting - Dedicated Server