Template:DisplayBox: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(moved documentation from the comments to a visible box)
(replaced template:Switch with parser function #switch)
 
Line 1: Line 1:
<includeonly>
<includeonly>
<div style="margin: 0; margin-right: {{{marginR|30px}}}; margin-left: {{{marginL|30px}}}; margin-top: {{{marginT|0}}}; margin-bottom: {{{marginB|0}}}; border:{{{bdwidth|1}}}px solid {{{bdcolor|#3399ff}}}; padding: {{{padding|0.4em 1em 0.4em 1em}}}; background-color:{{switch|{{{bgcolor|{{#ifeq:{{NAMESPACE}}|Template|g|grey}}}}}|
<div style="margin: 0; margin-right: {{{marginR|30px}}}; margin-left: {{{marginL|30px}}}; margin-top: {{{marginT|0}}}; margin-bottom: {{{marginB|0}}}; border:{{{bdwidth|1}}}px solid {{{bdcolor|#3399ff}}}; padding: {{{padding|0.4em 1em 0.4em 1em}}}; background-color:{{#switch:{{{bgcolor|{{#ifeq:{{NAMESPACE}}|Template|g|grey}}}}}|
case: grey=#dddddd|
grey=#dddddd|
case: char=#bbbbbb|
char=#bbbbbb|
case: none=#ffffff|
none=#ffffff|
case: g=#ddffdd|
g=#ddffdd|
case: r=#ffdddd|
r=#ffdddd|
case: y=#eeeeb8|
y=#eeeeb8|
case: b=#ddddff|
b=#ddddff|
case: m=#e8d4ee|
m=#e8d4ee|
case: o=#ffeebb|
o=#ffeebb|
case: w=#ffffff|
w=#ffffff|
case: gs0=#ffffff|
gs0=#ffffff|
case: gs1=#eeeeee|
gs1=#eeeeee|
case: gs2=#dddddd|
gs2=#dddddd|
case: gs3=#cccccc|
gs3=#cccccc|
case: gs4=#bbbbbb|
gs4=#bbbbbb|
case: gs5=#aaaaaa|
gs5=#aaaaaa|
default={{{bgcolor}}}}};">{{#if:{{{title|}}}|<center><big><b>{{{title}}}</b></big></center>}}
#default={{{bgcolor}}}}};">{{#if:{{{title|}}}|<center><big><b>{{{title}}}</b></big></center>}}
{{{text|{{{1|'''''Error:''' Text is missing!''}}}}}}
{{{text|{{{1|'''''Error:''' Text is missing!''}}}}}}
</div></includeonly><noinclude>{{Doc|
</div></includeonly><noinclude>{{Doc|

Latest revision as of 16:45, 16 June 2017

Documentation

Centered box with fixed margins for displaying material

Syntax:

{{DisplayBox|<displayed text>}}

Optional parameters:

|marginL=<margin-left, default=30px>
|marginR=<margin-right, default=30px>
|marginB=<margin-bottom, default=0>
|marginT=<margin-top, default=0>
|bdwidth=<borderwidth in pixels, default=1> 
|bdcolor=<bordercolor, default=#3399ff>
|padding=<padding, default=0.4em 1em 0.4em 1em (top, right, bottom, left)>
|bgcolor=<backgroundcolor, default=#d8d8d8;> other options include:
   grey=#dddddd
   char=#bbbbbb (charcoal)
   g   =#ddffdd (green)
   r   =#ffdddd (red)
   y   =#ffffbb (yellow)
   b   =#ddddff (blue)
   m   =#ddccff (magenta)
   o   =#ffeebb (orange)
   none=#ffffff (white)
   w   =#ffffff (white)
|title=<optional; a centered title displayed in bold>
|text=<text to display, defaults to parameter 1 when no optional parameters are used>