Link/Hash – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (workaround # list)
(Add display text parameter)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}
<includeonly>{{#if:{{{1|}}}
|[[{{{1}}}{{!}}{{#ifeq:{{#pos:{{Trim|{{{1}}}}}|#}}|0
|[[{{{1}}}{{!}}{{#if:{{{2|}}}
|{{{2}}}
|{{#ifeq:{{#pos:{{Trim|{{{1}}}}}|#}}|0
|{{#replace:{{#replace:{{#sub:{{Trim|{{{1}}}}}|1}}|_|<nowiki/> <nowiki/>}}|#|&#35;}}
|{{#replace:{{#replace:{{#sub:{{Trim|{{{1}}}}}|1}}|_|<nowiki/> <nowiki/>}}|#|&#35;}}
|{{#replace:{{#explode:{{Trim|{{{1}}}}}|#|0|0|2}} - {{#explode:{{Trim|{{{1}}}}}|#|1|2}}|_|<nowiki/> <nowiki/>}}
|{{#replace:{{#explode:{{Trim|{{{1}}}}}|#|0|0|2}} - {{#explode:{{Trim|{{{1}}}}}|#|1|2}}|_|<nowiki/> <nowiki/>}}
}}]]
}}}}]]
|-no link specified-
|-no link specified-
}}</includeonly><noinclude>
}}</includeonly><noinclude>Creates an auto-formatted hash link (e.g <tt>#value</tt> or <tt>page#anchor</tt>).
Creates an auto-formatted hash link (e.g <tt>#value</tt> or <tt>page#anchor</tt>).


== Usage ==
== Usage ==
{{<nowiki/>HashLink|'''''haskLink'''''}}
{{<nowiki/>HashLink|'''''hashLink'''''|'''''text'''''}}
* hashLink: wiki hash link, e.g <tt>#toc</tt> or <tt>Arma 3#Key features</tt>
* hashLink: wiki hash link, e.g <tt>#toc</tt> or <tt>Arma 3#Key features</tt>
* text: display text


{| class="wikitable"
{| class="wikitable"
Line 25: Line 27:
| <nowiki>{{HashLink|#Multipart Hashlink}}</nowiki>
| <nowiki>{{HashLink|#Multipart Hashlink}}</nowiki>
| {{HashLink|#Multipart Hashlink}}
| {{HashLink|#Multipart Hashlink}}
|-
| <nowiki>{{HashLink|#Multipart Hashlink|Display text}}</nowiki>
| {{HashLink|#Multipart Hashlink|Display text}}
|-
|-
| <nowiki>{{HashLink|Arma_3#Key_features}}</nowiki>
| <nowiki>{{HashLink|Arma_3#Key_features}}</nowiki>
Line 31: Line 36:
| <nowiki>{{HashLink|Arma 3#Key features}}</nowiki>
| <nowiki>{{HashLink|Arma 3#Key features}}</nowiki>
| {{HashLink|Arma 3#Key features}}
| {{HashLink|Arma 3#Key features}}
|-
| <nowiki>{{HashLink|Arma 3#Key features|A3's Key Features}}</nowiki>
| {{HashLink|Arma 3#Key features|A3's Key Features}}
|-
|-
| <nowiki>.{{HashLink|Arma 3#Key features}}.</nowiki>
| <nowiki>.{{HashLink|Arma 3#Key features}}.</nowiki>

Revision as of 22:39, 17 August 2021

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
.{{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