ConfigPage – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Fix notoc doc)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{lc:{{{1}}}}}
<includeonly>{{#switch:{{lc:{{{1}}}}}
|start=<div style{{=}}"float:right;margin-left:1em;" class{{=}}"nonumtoc"> __TOC__ </div><div class{{=}}"cfg_reference">
|start= {{#if:{{{notoc|}}}||{{TOC|side|1||nonum}}}}
{{Hatnote|{{#switch:{{PAGENAME}}
<div class="cfg_reference"{{#if:{{{notoc|}}}|<nowiki/> style="width: auto"}}>
    |CfgMagazines Config Reference='''See also''': [[CfgMoves Config Reference]], [[CfgWeapons Config Reference]], [[CfgAmmo Config Reference]] and [[CfgVehicles Config Reference]]
{{#switch:{{PAGENAME}}
    |CfgMoves Config Reference='''See also''': [[CfgMagazines Config Reference]], [[CfgWeapons Config Reference]], [[CfgAmmo Config Reference]], [[CfgMovesFatigue]] and [[CfgVehicles Config Reference]]
|CfgMoves Config Reference
    |CfgMoves Config Reference='''See also''': [[CfgMoves Config Reference]] and [[CfgVehicles Config Reference]]
|CfgVehicles Config Reference
    |CfgWeapons Config Reference='''See also''': [[CfgMagazines Config Reference]], [[CfgMoves Config Reference]], [[CfgAmmo Config Reference]] and [[CfgVehicles Config Reference]]
|CfgWeapons Config Reference
    |CfgAmmo Config Reference='''See also''': [[CfgMagazines Config Reference]], [[CfgMoves Config Reference]], [[CfgWeapons Config Reference]] and [[CfgVehicles Config Reference]]
|CfgMagazines Config Reference
    |CfgVehicles Config Reference='''See also''': [[CfgMagazines Config Reference]], [[CfgMoves Config Reference]], [[CfgWeapons Config Reference]] and [[CfgAmmo Config Reference]]
|CfgAmmo Config Reference= {{TopMenu|[[CfgMoves Config Reference]] {{#ifeq:{{PAGENAME}}|CfgMoves Config Reference|[[Arma 3: CfgMovesFatigue]]}} [[CfgVehicles Config Reference]] [[CfgWeapons Config Reference]] [[CfgMagazines Config Reference]] [[CfgAmmo Config Reference]]}}
}}}}
}}
|abc=<div class{{=}}"abc">
|abc= <div class="abc">
|end=</div></div>}}</includeonly><noinclude>
|end= </div></div>
===Usage===
|#default= <div>Wrong {{Template|ConfigPage}} template usage!{{#if:{{{1|}}}|<nowiki/> "{{{1}}}" is an invalid value.}}{{TemplateCase||[[Category:ConfigPage template usage error]]}}</div>
Place {{Inline code|<nowiki>{{Cfg ref|start}}</nowiki>}} at the very top of a ''Cfg* Config Reference'' page,
}}</includeonly><noinclude>{{Doc/Template
|descr= This template in three parts (all mandatory) creates and styles a config page. It automatically adds the table of contents (ToC) ''via'' {{Template|TOC}} usage.<br>
A special {{Template|TopMenu}} is added to the following pages:
* [[CfgMoves Config Reference]]
* [[CfgVehicles Config Reference]]
* [[CfgWeapons Config Reference]]
* [[CfgMagazines Config Reference]]
* [[CfgAmmo Config Reference]]
|param1= type
|descr1= (case-insensitive) can be one of:
** start - to be placed at the very top of a Cfg page
** abc - to be placed '''above''' the first letter:
*** a letter index is a '''level 3''' title (e.g {{hl|c= === A ===}})
*** an entry is a '''level 4''' title ((e.g {{hl|c= ==== Apple ====}})
*** an entry's subtitle can be a '''level 5''' title ((e.g {{hl|c= ===== Details =====}})
*** '''level 6''' titles are not stylised
** end - to be placed at the bottom of the page, just above categories
** notoc (named parameter) {{hl|1= notoc= y}} for ''start'' to avoid providing the TOC
|example1= <pre>{{ConfigPage}}</pre>
|result1= {{ConfigPage}}
|example2= <pre>{{ConfigPage|test}}</pre>
|result2= {{ConfigPage|test}}
|example3= <pre>{{ConfigPage|start}}


{{Inline code|<nowiki>{{Cfg ref|abc}}</nowiki>}} above the first alphabetical entry (<tt>====A====</tt>),
= Level 1 =


and {{Inline code|<nowiki>{{Cfg ref|end}}</nowiki>}} at the bottom, just above the ''Categories'' section.
Should not be used unless absolute necessity, e.g on a huge page where '''level 2''' are not enough.


This acts to dump all the required parts to form the page in a continuous fashion.
== Level 2 ==


[[Category:Templates|{{uc:{{PAGENAME}}}}]]</noinclude>
=== Level 3 ===
 
{{ConfigPage|abc}}
 
=== A ===
 
==== Apple ====
A fruit
 
=== B ===
 
==== Bee ====
An insect
 
=== C ===
 
==== Cow ====
A mammal
 
===== Details =====
But not just that
 
====== Level 6 ======
Not stylised.
 
{{ConfigPage|end}}</pre>
|result3= {{ConfigPage|start}}
 
= Level 1 =
 
Should not be used unless absolute necessity, e.g on a huge page where '''level 2''' are not enough.
 
== Level 2 ==
 
=== Level 3 ===
 
{{ConfigPage|abc}}
 
=== A ===
 
==== Apple ====
A fruit
 
=== B ===
 
==== Bee ====
An insect
 
=== C ===
 
==== Cow ====
A mammal
 
===== Details =====
But not just that
 
====== Level 6 ======
Not stylised.
 
{{ConfigPage|end}}
}}
</noinclude>

Latest revision as of 18:32, 5 August 2024

This template in three parts (all mandatory) creates and styles a config page. It automatically adds the table of contents (ToC) via {{TOC}} usage.
A special {{TopMenu}} is added to the following pages:

This template is used on these pages.

Usage

{{ConfigPage|type}}

  • type: (case-insensitive) can be one of:
    • start - to be placed at the very top of a Cfg page
    • abc - to be placed above the first letter:
      • a letter index is a level 3 title (e.g === A ===)
      • an entry is a level 4 title ((e.g ==== Apple ====)
      • an entry's subtitle can be a level 5 title ((e.g ===== Details =====)
      • level 6 titles are not stylised
    • end - to be placed at the bottom of the page, just above categories
    • notoc (named parameter) notoc= y for start to avoid providing the TOC
Examples
Code Result
{{ConfigPage}}
Wrong {{ConfigPage}} template usage!
{{ConfigPage|test}}
Wrong {{ConfigPage}} template usage! "test" is an invalid value.
{{ConfigPage|start}}

= Level 1 =

Should not be used unless absolute necessity, e.g on a huge page where '''level 2''' are not enough.

== Level 2 ==

=== Level 3 ===

{{ConfigPage|abc}}

=== A ===

==== Apple ====
A fruit

=== B ===

==== Bee ====
An insect

=== C ===

==== Cow ====
A mammal

===== Details =====
But not just that

====== Level 6 ======
Not stylised.

{{ConfigPage|end}}

Level 1

Should not be used unless absolute necessity, e.g on a huge page where level 2 are not enough.

Level 2

Level 3

A

Apple

A fruit

B

Bee

An insect

C

Cow

A mammal

Details

But not just that

Level 6

Not stylised.