Jump to content

Template:Navbox: Difference between revisions

From DevilutionX Wiki
Use CSS instead of hardcoding colors due to users being able to select light or dark mode.
Fix errors
Line 3: Line 3:
! colspan="2" class="dxx-navbox-title" | {{{title|Navigation}}}
! colspan="2" class="dxx-navbox-title" | {{{title|Navigation}}}


<!-- ===== BLOCK 1 ===== -->
{{#if:{{{header1|}}}|
|-
|-
! colspan="2" class="dxx-navbox-header" | {{{header1}}}
! colspan="2" class="dxx-navbox-header" | {{{header1|}}}
}}
{{#if:{{{group1|}}}{{{list1|}}}|
|-
|-
! class="dxx-navbox-group" | {{{group1}}}
! class="dxx-navbox-group" | {{{group1|}}}
| class="dxx-navbox-list"  | {{{list1}}}
| class="dxx-navbox-list"  | {{{list1|}}}
}}


<!-- ===== BLOCK 2 ===== -->
{{#if:{{{header2|}}}|
|-
|-
! colspan="2" class="dxx-navbox-header" | {{{header2}}}
! colspan="2" class="dxx-navbox-header" | {{{header2|}}}
}}
{{#if:{{{group2|}}}{{{list2|}}}|
|-
|-
! class="dxx-navbox-group" | {{{group2}}}
! class="dxx-navbox-group" | {{{group2|}}}
| class="dxx-navbox-list"  | {{{list2}}}
| class="dxx-navbox-list"  | {{{list2|}}}
}}


<!-- ===== BLOCK 3 ===== -->
{{#if:{{{header3|}}}|
|-
|-
! colspan="2" class="dxx-navbox-header" | {{{header3}}}
! colspan="2" class="dxx-navbox-header" | {{{header3|}}}
}}
{{#if:{{{group3|}}}{{{list3|}}}|
|-
|-
! class="dxx-navbox-group" | {{{group3}}}
! class="dxx-navbox-group" | {{{group3|}}}
| class="dxx-navbox-list"  | {{{list3}}}
| class="dxx-navbox-list"  | {{{list3|}}}
}}


<!-- ===== BLOCK 4 ===== -->
{{#if:{{{header4|}}}|
|-
|-
! colspan="2" class="dxx-navbox-header" | {{{header4}}}
! colspan="2" class="dxx-navbox-header" | {{{header4|}}}
}}
{{#if:{{{group4|}}}{{{list4|}}}|
|-
|-
! class="dxx-navbox-group" | {{{group4}}}
! class="dxx-navbox-group" | {{{group4|}}}
| class="dxx-navbox-list"  | {{{list4}}}
| class="dxx-navbox-list"  | {{{list4|}}}
}}


<!-- ===== BLOCK 5 ===== -->
{{#if:{{{header5|}}}|
|-
|-
! colspan="2" class="dxx-navbox-header" | {{{header5}}}
! colspan="2" class="dxx-navbox-header" | {{{header5|}}}
}}
{{#if:{{{group5|}}}{{{list5|}}}|
|-
|-
! class="dxx-navbox-group" | {{{group5}}}
! class="dxx-navbox-group" | {{{group5|}}}
| class="dxx-navbox-list"  | {{{list5}}}
| class="dxx-navbox-list"  | {{{list5|}}}
}}


<!-- ===== BLOCK 6 ===== -->
{{#if:{{{header6|}}}|
|-
|-
! colspan="2" class="dxx-navbox-header" | {{{header6}}}
! colspan="2" class="dxx-navbox-header" | {{{header6|}}}
}}
{{#if:{{{group6|}}}{{{list6|}}}|
|-
|-
! class="dxx-navbox-group" | {{{group6}}}
! class="dxx-navbox-group" | {{{group6|}}}
| class="dxx-navbox-list"  | {{{list6}}}
| class="dxx-navbox-list"  | {{{list6|}}}
}}
 
<!-- ===== BLOCK 7 ===== -->
{{#if:{{{header7|}}}|
|-
! colspan="2" class="dxx-navbox-header" | {{{header7}}}
}}
{{#if:{{{group7|}}}{{{list7|}}}|
|-
! class="dxx-navbox-group" | {{{group7}}}
| class="dxx-navbox-list"  | {{{list7}}}
}}
 
<!-- ===== BLOCK 8 ===== -->
{{#if:{{{header8|}}}|
|-
! colspan="2" class="dxx-navbox-header" | {{{header8}}}
}}
{{#if:{{{group8|}}}{{{list8|}}}|
|-
! class="dxx-navbox-group" | {{{group8}}}
| class="dxx-navbox-list"  | {{{list8}}}
}}
 
<!-- ===== BLOCK 9 ===== -->
{{#if:{{{header9|}}}|
|-
! colspan="2" class="dxx-navbox-header" | {{{header9}}}
}}
{{#if:{{{group9|}}}{{{list9|}}}|
|-
! class="dxx-navbox-group" | {{{group9}}}
| class="dxx-navbox-list"  | {{{list9}}}
}}
 
<!-- ===== BLOCK 10 ===== -->
{{#if:{{{header10|}}}|
|-
! colspan="2" class="dxx-navbox-header" | {{{header10}}}
}}
{{#if:{{{group10|}}}{{{list10|}}}|
|-
! class="dxx-navbox-group" | {{{group10}}}
| class="dxx-navbox-list"  | {{{list10}}}
}}


|}
|}
Line 117: Line 43:


<noinclude>
<noinclude>
Generic navbox meta-template used to build navigation boxes.
Basic navbox meta-template used to build navigation boxes.
 
* <code>title</code> – required; navbox title
* <code>headerN</code> – optional section headers (full-width)
* <code>groupN</code> – label in left column
* <code>listN</code> – content in right column
 
Up to 6 header/group/list blocks are supported here. 
Copy-paste the pattern if you ever need more.


[[Category:Navbox templates]]
[[Category:Navbox templates]]
</noinclude>
</noinclude>

Revision as of 22:34, 30 November 2025


Basic navbox meta-template used to build navigation boxes.

  • title – required; navbox title
  • headerN – optional section headers (full-width)
  • groupN – label in left column
  • listN – content in right column

Up to 6 header/group/list blocks are supported here. Copy-paste the pattern if you ever need more.