ArgTitle – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
m (add rightArgument usage sample's parameter)
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div><div style="float: left; margin-right: 0.5em;">{{{3}}}</div>
<includeonly>{{#if:{{{1|}}}|<div>{{#if:{{{3|}}}|<div style="float: left; margin-right: 0.5em">{{{3}}}</div>}}{{#if:{{{4|}}}|<div style="float: right; margin-left: 0.5em">{{{4}}}</div>}}
{{#switch: {{{2}}} |1= = |2= == |3= === |4= ==== |5= ===== }} {{{1}}} {{#switch: {{{2}}} |1= = |2= == |3= === |4= ==== |5= ===== }}
{{#switch: {{{2}}} |1= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}} {{{1}}} {{#switch: {{{2}}} |1= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}}
</div></includeonly><noinclude><div class="toclimit-2">{{SideTOC}}</div>
</div>}}</includeonly><noinclude>__NOTOC__
Defines a wiki title (e.g <tt>=== Title ===</tt>)
 
== Usage ==
== Usage ==
<code><nowiki>{{ArgTitle|title|titleLevel|leftArgument}}</nowiki></code>
<code><nowiki>{{ArgTitle|title|titleLevel|leftArgument|rightArgument}}</nowiki></code>
* <tt>title</tt>: title text
* <tt>title</tt>: title text
* <tt>titleLevel</tt>: 1..6 number (number of "=" in wiki code for title, e.g {{Inline code|<nowiki>== title H2 ==</nowiki>}})
* <tt>titleLevel</tt>: (Optional, default 2) 1..6 number (number of "=" in wiki code for title, e.g {{Inline code|<nowiki>== title H2 ==</nowiki>}})
* <tt>leftArgument</tt>: any text that should be on the left of the title text (usually [[:Template:GVI|GVI]] or [[:Template:EffArg|EffArg]])
* <tt>leftArgument</tt>: (Optional, default empty) any text that should be on the left of the title text (usually [[:Template:GVI|GVI]] or [[:Template:EffArg|EffArg]])
 
* <tt>rightArgument</tt>: (Optional, default empty) any text that should be on the right of the title text (usually [[:Template:GVI|GVI]] or [[:Template:EffArg|EffArg]])
== Example ==
<code><nowiki>{{ArgTitle|Title text|3|{{GVI|arma3|1.50}}}}</nowiki></code>
 
 
== Code output ==
<syntaxhighlight lang="html"><div><div style="float: left; margin-right: 0.5em;">{{GVI|arma3|1.50}}</div>
=== Title text ===
</div></syntaxhighlight>
 
 
== Output ==
{{ArgTitle|Title text|3|{{GVI|arma3|1.50}}}}


{| class="wikitable"
|+ Examples
! Code
! style="min-width: 15em" | Result
|-
| <nowiki>{{ArgTitle}}</nowiki>
| {{ArgTitle}}
|-
| <nowiki>{{ArgTitle|My Title}}</nowiki>
|
{{ArgTitle|My Title}}
|-
| <nowiki>{{ArgTitle|My Title|4}}</nowiki>
|
{{ArgTitle|My Title|4}}
|-
| <nowiki>{{ArgTitle|My Title|4|Left}}</nowiki>
|
{{ArgTitle|My Title|4|Left}}
|-
| <nowiki>{{ArgTitle|My Title|4|Left|Right}}</nowiki>
|
{{ArgTitle|My Title|4|Left|Right}}
|-
| <nowiki>{{ArgTitle|My Title|4||Right}}</nowiki>
|
{{ArgTitle|My Title|4||Right}}
|}


[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude>
[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude>

Revision as of 20:25, 17 May 2020

Defines a wiki title (e.g === Title ===)

Usage

{{ArgTitle|title|titleLevel|leftArgument|rightArgument}}

  • title: title text
  • titleLevel: (Optional, default 2) 1..6 number (number of "=" in wiki code for title, e.g == title H2 ==)
  • leftArgument: (Optional, default empty) any text that should be on the left of the title text (usually GVI or EffArg)
  • rightArgument: (Optional, default empty) any text that should be on the right of the title text (usually GVI or EffArg)
Examples
Code Result
{{ArgTitle}}
{{ArgTitle|My Title}}

My Title

{{ArgTitle|My Title|4}}

My Title

{{ArgTitle|My Title|4|Left}}
Left

My Title

{{ArgTitle|My Title|4|Left|Right}}
Left
Right

My Title

{{ArgTitle|My Title|4||Right}}
Right

My Title