Link/Hash – Template

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

Latest revision as of 21:07, 1 December 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|PreProcessor Commands##if}}
{{Link/Hash|CT_LISTNBOX#BIS_fnc_initList example}}
{{Link/Hash|:Category:Community Tools#Code Edition}}
{{Link/Hash|Arma Reforger:Server Hosting#Dedicated Server}}
{{Link/Hash|Template:Link#Usage}}

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