ArgTitle – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
(Fix flexbox)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><div><div style="float: left; margin-right: 0.5em;">{{{3}}}</div>
<includeonly>{{#if:{{{2|}}}|<div style="display: flex; align-items: baseline">{{#if:{{{3|}}}|<div style="margin-right: 0.5em">{{{3}}}</div>}}<div style="flex-grow: 1">
{{#switch: {{{2}}} |1= = |2= == |3= === |4= ==== |5= ===== }} {{{1}}} {{#switch: {{{2}}} |1= = |2= == |3= === |4= ==== |5= ===== }}
{{#switch: {{{1}}} |1= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}} {{{2}}} {{#switch: {{{1}}} |1= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}}
</div></includeonly><noinclude><div class="toclimit-2">{{SideTOC}}</div>
</div>{{#if:{{{4|}}}|<div style="margin-left: 0.5em">{{{4}}}</div>}}
== Usage ==
</div>|-no title defined!-{{TemplateCase||[[Category:ArgTitle template usage error]]}}}}</includeonly><noinclude>__NOTOC__{{Doc/Template
<code><nowiki>{{ArgTitle|title|titleLevel|leftArgument}}</nowiki></code>
|descr= Defines a wiki title (e.g {{hl|c= === Title ===}})
* <tt>title</tt>: title text
|param1= level
* <tt>titleLevel</tt>: 1..6 number (number of "=" in wiki code for title, e.g {{Inline code|<nowiki>== title H2 ==</nowiki>}})
|descr1= (Optional, default 2) 1..6 number (number of "{{=}}" in wiki wode for title, e.g <syntaxhighlight lang="html+handlebars" inline>== title H2 ==</syntaxhighlight>)
* <tt>leftArgument</tt>: any text that should be on the left of the title text (usually [[:Template:GVI|GVI]] or [[:Template:EffArg|EffArg]])
|param2= title
 
|descr2= title text
== Example ==
|param3= left
<code><nowiki>{{ArgTitle|Title text|3|{{GVI|arma3|1.50}}}}</nowiki></code>
|descr3= (Optional, default empty) any text that should be on the left of the title text (usually {{Template|GVI}} or {{Template|Icon}})
 
|param4= right
 
|descr4= (Optional, default empty) any text that should be on the right of the title text (usually {{Template|GVI}} or {{Template|Icon}})
== Code output ==
|example1= style="min-width: 15em" {{!}} <nowiki>{{ArgTitle}}</nowiki>
<syntaxhighlight lang="html"><div><div style="float: left; margin-right: 0.5em;">{{GVI|arma3|1.50}}</div>
|result1= style="min-width: 15em" {{!}} {{ArgTitle}}
=== Title text ===
|example2= <nowiki>{{ArgTitle|4}}</nowiki>
</div></syntaxhighlight>
|result2= {{ArgTitle|4}}
 
|example3= <nowiki>{{ArgTitle|4|My Title}}</nowiki>
 
|result3= {{ArgTitle|4|My Title}}
== Output ==
|example4= <nowiki>{{ArgTitle|4|My Title|Left}}</nowiki>
{{ArgTitle|Title text|3|{{GVI|arma3|1.50}}}}
|result4= {{ArgTitle|4|My Title|Left}}
 
|example5= <nowiki>{{ArgTitle|4|My Title||Right}}</nowiki>
 
|result5= {{ArgTitle|4|My Title||Right}}
[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude>
|example6= <nowiki>{{ArgTitle|4|My Title|Left|Right}}</nowiki>
|result6= {{ArgTitle|4|My Title|Left|Right}}
|example7= <nowiki>{{ArgTitle|4|Test|{{GVI|ofp|1.00}}|{{GVI|arma3|1.00}}}}</nowiki>
|result7= <br><br>{{ArgTitle|4|Test|{{GVI|ofp|1.00}}|{{GVI|arma3|1.00}}}}<br><br>
}}</noinclude>

Latest revision as of 19:38, 24 October 2023

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

This template is used on these pages.

Usage

{{ArgTitle|level|title|left|right}}

  • level: (Optional, default 2) 1..6 number (number of "=" in wiki wode for title, e.g == title H2 ==)
  • title: title text
  • left: (Optional, default empty) any text that should be on the left of the title text (usually {{GVI}} or {{Icon}})
  • right: (Optional, default empty) any text that should be on the right of the title text (usually {{GVI}} or {{Icon}})
Examples
Code Result
{{ArgTitle}} -no title defined!-
{{ArgTitle|4}} -no title defined!-
{{ArgTitle|4|My Title}}

My Title

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

My Title

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

My Title

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

My Title

Right
{{ArgTitle|4|Test|{{GVI|ofp|1.00}}|{{GVI|arma3|1.00}}}}

Test