ArgTitle – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Remove soon-to-be non-existent template link)
m (Add Template:Doc/Template usage)
Line 1: Line 1:
<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>}}
<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= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}} {{{1}}} {{#switch: {{{2}}} |1= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}}
{{#switch: {{{2}}} |1= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}} {{{1}}} {{#switch: {{{2}}} |1= = |#default|2= == |3= === |4= ==== |5= ===== |6= ======}}
</div>}}</includeonly><noinclude>__NOTOC__
</div>|-no title defined!-}}</includeonly><noinclude>__NOTOC__{{Doc/Template
Defines a wiki title (e.g <tt>=== Title ===</tt>)
|descr= Defines a wiki title (e.g <tt>=== Title ===</tt>)
 
|param1= title
== Usage ==
|descr1= title text
<code><nowiki>{{ArgTitle|title|titleLevel|leftArgument|rightArgument}}</nowiki></code>
|param2= level
* <tt>title</tt>: title text
|descr2= (Optional, default 2) 1..6 number (number of "{{=}}" in wiki wode 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>}})
|param3= left
* <tt>leftArgument</tt>: (Optional, default empty) any text that should be on the left of the title text (usually {{Template|GVI}} or {{Template|Icon}})
|descr3= (Optional, default empty) any text that should be on the left of the title text (usually {{Template|GVI}} or {{Template|Icon}})
* <tt>rightArgument</tt>: (Optional, default empty) any text that should be on the right 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}})
{| class="wikitable"
|example1= style="min-width: 15em" {{!}} <nowiki>{{ArgTitle}}</nowiki>
|+ Examples
|result1= style="min-width: 15em" {{!}} {{ArgTitle}}
! Code
|example2= <nowiki>{{ArgTitle|My Title}}</nowiki>
! style="min-width: 15em" | Result
|result2= {{ArgTitle|My Title}}
|-
|example3= <nowiki>{{ArgTitle|My Title|4}}</nowiki>
| <nowiki>{{ArgTitle}}</nowiki>
|result3= {{ArgTitle|My Title|4}}
| {{ArgTitle}}
|example4= <nowiki>{{ArgTitle|My Title|4|Left}}</nowiki>
|-
|result4= {{ArgTitle|My Title|4|Left}}
| <nowiki>{{ArgTitle|My Title}}</nowiki>
|example5= <nowiki>{{ArgTitle|My Title|4||Right}}</nowiki>
|
|result5= {{ArgTitle|My Title|4||Right}}
{{ArgTitle|My Title}}
|example6= <nowiki>{{ArgTitle|My Title|4|Left|Right}}</nowiki>
|-
|result6= {{ArgTitle|My Title|4|Left|Right}}
| <nowiki>{{ArgTitle|My Title|4}}</nowiki>
}}</noinclude>
|
{{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>

Revision as of 23:41, 7 February 2021

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

This template is used on these pages.

Usage

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

  • title: title text
  • level: (Optional, default 2) 1..6 number (number of "=" in wiki wode for title, e.g == title H2 ==)
  • 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|My Title}}

My Title

{{ArgTitle|My Title|4}}

My Title

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

My Title

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

My Title

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

My Title