Link/Internal – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix attempt)
m (Final fix)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if: {{{link|}}}
<includeonly>{{#if: {{{link|}}}
| {{#ifeq: {{#pos:{{Trim|{{{link}}}}}|#}}
| {{#ifeq: {{#pos:{{Trim|{{{link}}}}}|#}}
| | {{#ifeq: {{NAMESPACENUMBER}} | {{NAMESPACENUMBER:{{{link}}}}}
|
| [[{{{link}}}{{#if:{{{text|}}}|{{!}}{{{text}}}|{{#ifeq: {{NAMESPACENUMBER}} | {{NAMESPACENUMBER:{{{link}}}}} | {{!}} {{PAGENAME:{{{link}}}}} }}}}]]
| {{#ifeq: {{NAMESPACENUMBER}} | {{NAMESPACENUMBER:{{{link}}}}}
| [[{{{link}}}{{#if:{{{text|}}}|{{!}}{{{text}}}|{{#ifeq: {{NAMESPACENUMBER}} | {{NAMESPACENUMBER:{{{link}}}}} | {{!}}<!-- no space here or the link's text will start with it! -->{{PAGENAME:{{{link}}}}}}}}}]]
| [[{{{link}}}{{#if:{{{text|}}}|{{!}}{{{text}}}}}]]
| [[{{{link}}}{{#if:{{{text|}}}|{{!}}{{{text}}}}}]]
}}
}}
Line 8: Line 9:
}}
}}
| -no link provided-{{TemplateCase||[[Category:Link template usage error]]}}
| -no link provided-{{TemplateCase||[[Category:Link template usage error]]}}
}}</includeonly><noinclude>{{Doc/Template
}}</includeonly><noinclude>
{{Doc/Template
|descr= This template creates an internal link (within the BIKI). It uses {{Template|Link/Hash}}.<br>
|descr= This template creates an internal link (within the BIKI). It uses {{Template|Link/Hash}}.<br>
If ''text'' is not provided:
If ''text'' is not provided:

Latest revision as of 02:50, 4 March 2024

This template creates an internal link (within the BIKI). It uses {{Link/Hash}}.
If text is not provided:

  • if link's namespace is identical to the current page, only the page name is used as text
  • otherwise, the full namespace:pagename is used

This template is used on these pages.

Usage

{{Link/Internal|link|text}}

  • link: the internal link
  • text: (Optional) the text to display
Examples
Code Result
{{Link/Internal}} -no link provided-
{{Link/Internal|link= setDir}} setDir
{{Link/Internal|text= setDir's page}} -no link provided-
{{Link/Internal|link= setDir|text= setDir's page}} setDir's page
{{Link/Internal|link= setDir#Example 1}} setDir - Example 1
{{Link/Internal|link= Category:Scripting Commands}}
Sets the page to said category - bad! The : prefix is unfortunately required, see below (no workaround found (yet?)).
{{Link/Internal|link= :Category:Scripting Commands}} Category:Scripting Commands
{{Link/Internal|link= :Category:Scripting Commands|text= All Commands}} All Commands
* {{Link/Internal|link= DayZ:Diag Menu}}
* {{Link/Internal|link= Template:Link}}
* {{Link/Internal|link= Template:Link#Usage}}