Link/Hash – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<tt>([^ =]+)<\/tt>" to "{{hl|$1}}")
m (Add Arma Reforger example - TODO: remove namespace prefix)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
|[[{{{1}}}{{!}}{{#if:{{{2|}}}
| [[{{{1}}}{{!}}{{#if:{{{2|}}}
|{{{2}}}
| {{{2}}}
|{{#ifeq:{{#pos:{{Trim|{{{1}}}}}|#}}|0
| {{#ifeq:{{#pos:{{Trim|{{{1}}}}}|#}}|0
|{{#replace:{{#sub:{{Trim|{{{1}}}}}|1}}|#|&#35;}}
| {{#replace:{{#sub:{{Trim|{{{1}}}}}|1}}|#|&#35;}}
|{{#replace:{{#explode:{{Trim|{{{1}}}}}|#|0|0|2}}|:Category:|}} - {{#explode:{{Trim|{{{1}}}}}|#|1|2}}
| {{#replace:{{#explode:{{Trim|{{{1}}}}}|#|0|0|2}}|:Category:|}} - {{#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>Creates an auto-formatted hash link (e.g {{hl|#value}} or {{hl|page#anchor}}).


Line 59: Line 59:
| <nowiki>{{HashLink|:Category:Community Tools#Code Edition}}</nowiki>
| <nowiki>{{HashLink|:Category:Community Tools#Code Edition}}</nowiki>
| {{HashLink|:Category:Community Tools#Code Edition}}
| {{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>
[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude>

Revision as of 16:21, 20 May 2022

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

Usage

{{HashLink|hashLink|text}}

  • hashLink: wiki hash link, e.g #toc or Arma 3#Key features
  • text: display text
Examples
Code Result
{{HashLink}} -no link specified-
{{HashLink|#toc}} toc
{{HashLink|#Multipart Hashlink}} Multipart Hashlink
{{HashLink|#Multipart Hashlink|Display text}} Display text
{{HashLink|Arma_3#Key_features}} Arma_3 - Key_features
{{HashLink|Arma 3#Key features}} Arma 3 - Key features
{{HashLink|Arma 3#Key features|A3's Key Features}} A3's Key Features
Edge Cases
.{{HashLink|Arma 3#Key features}}. .Arma 3 - Key features.
{{HashLink|##if}} #if
{{HashLink|##if#then##else}} #if#then##else
{{HashLink|PreProcessor Commands##if}} PreProcessor Commands - #if
{{HashLink|CT_LISTNBOX#BIS_fnc_initList example}} CT_LISTNBOX - BIS_fnc_initList example
{{HashLink|:Category:Community Tools#Code Edition}} Community Tools - Code Edition
{{HashLink|Arma Reforger:Server Hosting#Dedicated Server}} Arma Reforger:Server Hosting - Dedicated Server