Difference between revisions of "Template:Navbox"

From comp.tf
Jump to navigation Jump to search
(Applying styles)
 
(36 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| class="mw-collapsible {{#if:{{{collapsed|}}} | mw-collapsed |}} navbox"
+
{| class="mw-collapsible {{#if:{{{collapsed|}}} | mw-collapsed |}} navbox" style="border:1px solid #aaa;" cellpadding="2"
 
|-
 
|-
! {{#if:{{{templatename|}}}|<span class="controls">[[Template:{{{templatename}}}|v]] &middot; [[Template talk:{{{templatename}}}|d]] &middot; <span class="plainlinks">[{{fullurl:Template:{{{templatename}}}|action=edit}} e]</span></span>|}}{{{title}}}
+
| colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|3|2}} class="comptf-plainlinks" style="border:2px solid {{{header_border|#d5d5d5}}}; background-color: {{{header_fill|#d5d5d5}}}; color:{{{header_text|black}}}; font-size:12px; padding:2px; text-align:center" | <div class="comptf-controls" style="vertical-align:top; float:left; margin:2px; width:40px">{{VDE|{{{templatename|}}}}}</div><span style="font-size:15px">'''{{{title|}}}'''</span>
 
|-
 
|-
 
{{#if:{{{group1|}}} |
 
{{#if:{{{group1|}}} |
 
{{!}} class="group" {{!}} '''{{{group1}}}'''
 
{{!}} class="group" {{!}} '''{{{group1}}}'''
{{!}} class="row1" {{!}} {{{list1}}}
+
{{#if:{{{subgroup1|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup1|}}}''' }}
 +
{{!}} class="row1" colspan={{#if:{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list1}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group2|}}} |
 
{{#if:{{{group2|}}} |
 
{{!}} class="group" {{!}} '''{{{group2}}}'''
 
{{!}} class="group" {{!}} '''{{{group2}}}'''
{{!}} {{{list2}}}
+
{{#if:{{{subgroup2|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup2|}}}''' }}
 +
{{!}} colspan={{#if:{{{subgroup1|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list2}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group3|}}} |
 
{{#if:{{{group3|}}} |
 
{{!}} class="group" {{!}} '''{{{group3}}}'''
 
{{!}} class="group" {{!}} '''{{{group3}}}'''
{{!}} class="row1" {{!}} {{{list3}}}
+
{{#if:{{{subgroup3|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup3|}}}''' }}
 +
{{!}} class="row1" colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list3}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group4|}}} |
 
{{#if:{{{group4|}}} |
 
{{!}} class="group" {{!}} '''{{{group4}}}'''
 
{{!}} class="group" {{!}} '''{{{group4}}}'''
{{!}} {{{list4}}}
+
{{#if:{{{subgroup4|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup4|}}}''' }}
 +
{{!}} colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list4}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group5|}}} |
 
{{#if:{{{group5|}}} |
 
{{!}} class="group" {{!}} '''{{{group5}}}'''
 
{{!}} class="group" {{!}} '''{{{group5}}}'''
{{!}} class="row1" {{!}} {{{list5}}}
+
{{#if:{{{subgroup5|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup5|}}}''' }}
 +
{{!}} class="row1" colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list5}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group6|}}} |
 
{{#if:{{{group6|}}} |
 
{{!}} class="group" {{!}} '''{{{group6}}}'''
 
{{!}} class="group" {{!}} '''{{{group6}}}'''
{{!}} {{{list6}}}
+
{{#if:{{{subgroup6|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup6|}}}''' }}
 +
{{!}} colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list6}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group7|}}} |
 
{{#if:{{{group7|}}} |
 
{{!}} class="group" {{!}} '''{{{group7}}}'''
 
{{!}} class="group" {{!}} '''{{{group7}}}'''
{{!}} class="row1" {{!}} {{{list7}}}
+
{{#if:{{{subgroup7|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup7|}}}''' }}
 +
{{!}} class="row1" colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup8|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list7}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group8|}}} |
 
{{#if:{{{group8|}}} |
 
{{!}} class="group" {{!}} '''{{{group8}}}'''
 
{{!}} class="group" {{!}} '''{{{group8}}}'''
{{!}} {{{list8}}}
+
{{#if:{{{subgroup8|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup8|}}}''' }}
 +
{{!}} colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup9|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list8}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group9|}}} |
 
{{#if:{{{group9|}}} |
 
{{!}} class="group" {{!}} '''{{{group9}}}'''
 
{{!}} class="group" {{!}} '''{{{group9}}}'''
{{!}} class="row1" {{!}} {{{list9}}}
+
{{#if:{{{subgroup9|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup9|}}}''' }}
 +
{{!}} class="row1" colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup10|}}}|2|1}} {{!}} {{{list9}}}
 
|}}
 
|}}
 
|-
 
|-
 
{{#if:{{{group10|}}} |
 
{{#if:{{{group10|}}} |
 
{{!}} class="group" {{!}} '''{{{group10}}}'''
 
{{!}} class="group" {{!}} '''{{{group10}}}'''
{{!}} {{{list10}}}
+
{{#if:{{{subgroup10|}}} |
 +
{{!}} class="group" style="background-color:#e9e9e9;" {{!}} '''{{{subgroup10|}}}''' }}
 +
{{!}} colspan={{#if:{{{subgroup1|}}}{{{subgroup2|}}}{{{subgroup3|}}}{{{subgroup4|}}}{{{subgroup5|}}}{{{subgroup6|}}}{{{subgroup7|}}}{{{subgroup8|}}}{{{subgroup9|}}}|2|1}} {{!}} {{{list10}}}
 
|}}
 
|}}
 
|}<noinclude>
 
|}<noinclude>
Line 61: Line 81:
 
| templatename = Maps navbox //This is the name of the sub-template page you'll be creating, without the Template: prefix.
 
| templatename = Maps navbox //This is the name of the sub-template page you'll be creating, without the Template: prefix.
 
| collapsed = true //Omitting this parameter completely will leave the navbox uncollapsed.
 
| collapsed = true //Omitting this parameter completely will leave the navbox uncollapsed.
| title = [[Maplist|<span style="color: #fff">List of maps played in competitive TF2</span>]]
+
| title = [[Maplist|List of maps played in competitive TF2]]
 
| group1 = [[5CP]]
 
| group1 = [[5CP]]
 
| list1 = [[cp_badlands|Badlands]] &middot; [[cp_granary|Granary]]
 
| list1 = [[cp_badlands|Badlands]] &middot; [[cp_granary|Granary]]
Line 71: Line 91:
 
| templatename = Maps navbox
 
| templatename = Maps navbox
 
| collapsed = true
 
| collapsed = true
| title = [[Maplist|<span style="color: #fff">List of maps played in competitive TF2</span>]]
+
| title = [[Maplist|List of maps played in competitive TF2]]
 
| group1 = [[5CP]]
 
| group1 = [[5CP]]
 
| list1 = [[cp_badlands|Badlands]] &middot; [[cp_granary|Granary]]
 
| list1 = [[cp_badlands|Badlands]] &middot; [[cp_granary|Granary]]
 
}}
 
}}
 +
 +
[[Category:Navboxes| ]]

Latest revision as of 09:12, 19 June 2022

Usage[edit]

This template creates a navigation box, same as the ones on other wikis. This template should not be used directly on pages, but it should be used to create other templates. These are linked on pages to prevent redundancy.

Syntax:

{{Navbox
| templatename = Maps navbox //This is the name of the sub-template page you'll be creating, without the Template: prefix.
| collapsed = true //Omitting this parameter completely will leave the navbox uncollapsed.
| title = [[Maplist|List of maps played in competitive TF2]]
| group1 = [[5CP]]
| list1 = [[cp_badlands|Badlands]] · [[cp_granary|Granary]]
...
}}

will yield