Difference between revisions of "Template:Navbox"

From Machina Main Cluster Official Wiki
Jump to: navigation, search
Tag: mw-reverted
Tag: mw-reverted
Line 1: Line 1:
{| align="center" style="width: 94%; clear: both; background-color: {{{boxbackcolor|#f8f8ff}}}; border-width: thin; border-style: solid; border-color: {{{bordercolor|#D28A0D}}}; padding: 0em 0em 0em 0.3em;"
+
<includeonly>{{#switch:{{{border|{{{1|}}}}}}|subgroup|child=|none=|#default=<nowiki/>
|style="width: 100%; margin: 1em; text-align: center; padding: 0.1em; background-color: {{{titlebackcolor|#ccddee}}}; color: {{{titlecolor|#000000}}}"| '''{{{title}}}'''
+
{{{!}} class="navbox" cellspacing="0" style="{{{bodystyle|}}};{{{style|}}}"
|rowspan="2" style="width: 0%;"| {{{image|}}}
+
{{!}}-
|-
+
{{!}} style="padding:2px" {{!}} }}
|style="width: 100%; margin: 1em; text-align: {{{align|center}}}; padding: 0.5em 1em; color: {{{listcolor|#000000}}}; font-size: {{{fontsize|100}}}%"| {{{list}}}
+
{{{!}} cellspacing="0" class="nowraplinks {{#if:{{{title|}}}|{{#switch:{{{state|}}}|plain|off=|open|show=mw-collapsible|auto|autocollapse=mw-collapsible autocollapse|#default=mw-collapsible mw-collapsed}}}} {{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=navbox-subgroup" style="width:100%;{{{bodystyle|}}};{{{style|}}}|#default=" style="width:100%;background:transparent;color:inherit}};{{{innerstyle|}}}" <!--
|}{{{category|}}}<noinclude>
+
--- Title and navbar ---
 +
-->{{#if:{{{title|}}}|<nowiki/>
 +
{{!}}- {{#if:{{{titlegroup|}}}|<nowiki/>
 +
{{!}} class="navbox-group" style="{{{basestyle|}}};{{{groupstyle|}}};{{{titlegroupstyle|}}}" {{!}} {{{titlegroup|}}}
 +
! style="border-left:2px solid #fdfdfd;width:100%;|<nowiki/>
 +
! style="}}{{{basestyle|}}};{{{titlestyle|}}}" colspan={{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}{{#if:{{{titlegroup|}}}|-1}}}} class="navbox-title {{#if:{{{titleclass|}}}|{{{titleclass}}}}}" {{!}} {{#if:{{#switch:{{{navbar|}}}|plain|off=1}} {{#if:{{{name|}}}||{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=1}}}}| {{#ifeq:{{{navbar|}}}|off|{{#ifeq:{{{state|}}}|plain|<div class="nomobile navspace-big" style="float:right;width:6em">&nbsp;</div>}}| {{#ifeq:{{{state|}}}|plain||<div class="nomobile navspace-big" style="float:left;width:6em;text-align:left">&nbsp;</div>}}}}| <div class="nomobile navspace-big" style="float:left;width:6em;text-align:left"> {{Tnavbar|{{{name}}}|fontstyle={{{basestyle|}}};{{{titlestyle|}}};border:none;|mini=1}} </div>{{#ifeq:{{{state|}}}|plain|<div class="nomobile navspace-big" style="float:right;width:6em">&nbsp;</div>|<div class="nomobile navspace-small" style="float:right;width:2.35em">&nbsp;</div>}}}} <span style="font-size:{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=100|#default=110}}%"> {{{title}}}</span> }}<!--
 +
--- Above ---
 +
-->{{#if:{{{above|}}}| {{#if:{{{title|}}}|<nowiki/>
 +
{{!}}- style="height:2px"
 +
{{!}} }}
 +
{{!}}-
 +
{{!}} class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}" {{!}} {{{above}}} }}<!--
 +
--- First group/list and images ---
 +
-->{{#if:{{{list1|}}}|{{#if:{{{title|}}}{{{above|}}}|<nowiki/>
 +
{{!}}- style="height:2px"
 +
{{!}} }}
 +
{{!}}-<!--
 +
-->{{#if:{{{imageleft|}}}|<nowiki/>
 +
{{!}} style="width:0%;padding:0px 2px 0px 0px;{{{imageleftstyle|}}}" rowspan={{#expr:1{{#forargs:list|key|value|{{#ifeq:{{#expr:{{#len:{{#var:key}}}}<5}}|1|{{#ifeq:{{#var:key}}|1||{{#if:{{{list{{#var:key}}|}}}|+2}}}}}}}}}} {{!}} {{{imageleft|}}} }}<!--
 +
-->{{#if:{{{group1|}}}|<nowiki/>
 +
{{!}} class="navbox-group" style="{{{basestyle|}}};{{{groupstyle|}}};{{{group1style|}}}" {{!}} {{{group1}}}
 +
{{!}} style="text-align:left;border-left:2px solid #fdfdfd;|<nowiki/>
 +
{{!}} colspan=2 style="}} width:100%;padding:0px;{{{liststyle|}}};{{{oddstyle|}}};{{{list1style|}}}" class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" {{!}} <div style="padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}}">{{{list1|}}}</div><!--
 +
-->{{#if:{{{image|}}}|<nowiki/>
 +
{{!}} style="width:0%;padding:0px 0px 0px 2px;{{{imagestyle|}}}" rowspan={{#expr:1{{#forargs:list|key|value|{{#ifeq:{{#expr:{{#len:{{#var:key}}}}<5}}|1|{{#ifeq:{{#var:key}}|1||{{#if:{{{list{{#var:key}}|}}}|+2}}}}}}}}}} {{!}} {{{image|}}} }} }}<!--
 +
--- Remaining groups/lists ---
 +
-->{{#forargs:list|key|value|{{#ifeq:{{#expr:{{#len:{{#var:key}}}}<5}}|1|{{#ifeq:{{#var:key}}|1||{{#if:{{#var:value}}| {{#if:{{{title|}}}{{{above|}}}{{{list{{#expr:{{#var:key}}-1}}|}}}|<nowiki/>
 +
{{!}}- style="height:2px"
 +
{{!}} }}
 +
{{!}}- {{#if:{{{group{{#var:key}}|}}}|<nowiki/>
 +
{{!}} class="navbox-group" style="{{{basestyle|}}};{{{groupstyle|}}};{{{group{{#var:key}}style|}}}" {{!}} {{{group{{#var:key}}}}}
 +
{{!}} style="text-align:left;border-left:2px solid #fdfdfd;|<nowiki/>
 +
{{!}} colspan=2 style="}} width:100%;padding:0px;{{{liststyle|}}};{{{evenstyle|}}};{{{list{{#var:key}}style|}}}" class="navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" {{!}} <div style="padding:{{{listpadding|0em 0.25em}}}">{{#var:value}}}}</div>}}}}}}<!--
 +
--- Below ---
 +
-->{{#if:{{{below|}}}|<!--
 +
-->{{#if:{{{title|}}}{{{above|}}}{{{list1|}}}{{{list2|}}}{{{list3|}}}|<nowiki/>
 +
{{!}}- style="height:2px"
 +
{{!}} }}
 +
{{!}}-
 +
{{!}} class="navbox-abovebelow" style="{{{basestyle|}}};{{{belowstyle|}}}" colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}" {{!}} {{{below}}} }}
 +
{{!}}}{{#switch:{{{border|{{{1|}}}}}}|subgroup|child=|none=|#default=<nowiki/>
 +
{{!}}} }}</includeonly><noinclude>
 +
== State usage ==
 +
These are guidelines for the <code>state</code> parameter:
 +
* <code>|state='''collapsed'''</code> - The table is collapsible and collapsed (default).
 +
* <code>|state='''open'''</code> - The table is collapsible and not collapsed.
 +
* <code>|state='''auto'''</code> - The table is collapsible and will collapse if multiple boxes are present.
 +
* <code>|state='''plain'''</code> - The table is not collapsible.
 +
 
 +
[[Category:Parent templates]]</noinclude>
 +
 
 
== Parameters ==
 
== Parameters ==
 
{| {{STDT}}
 
{| {{STDT}}

Revision as of 20:28, 23 August 2021

State usage

These are guidelines for the state parameter:

  • |state=collapsed - The table is collapsible and collapsed (default).
  • |state=open - The table is collapsible and not collapsed.
  • |state=auto - The table is collapsible and will collapse if multiple boxes are present.
  • |state=plain - The table is not collapsible.

Parameters

Parameter Optional? Default Notes
title The title (header) of the box
list The contents (list) of the box
image Optional
boxbackcolor Optional #f8f8ff The box's background color
bordercolor Optional #bebebe The box's border color
titlebackcolor Optional #ccddee The box's header background color
titlecolor Optional #000000 The box's header font color
align Optional center Use only these values:
  • center — Centers the text
  • justify — Stretches the lines so that each line has equal width
  • left — Aligns the text to the left
  • right — Aligns the text to the right
listcolor Optional #000000 The list's font color
fontsize Optional 100 The list's font size in percentages
category Optional
This Wiki contains NSFW content. All people mentioned are above the age of 18. By using this wiki you agree that you are of 18 years of age or over.