Template:DisplayBox: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(adding an optional title)
(replaced template:Switch with parser function #switch)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- centered box with fixed margins for displaying material, optional parameters:
<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}}}}}|
grey=#dddddd|
char=#bbbbbb|
none=#ffffff|
g=#ddffdd|
r=#ffdddd|
y=#eeeeb8|
b=#ddddff|
m=#e8d4ee|
o=#ffeebb|
w=#ffffff|
gs0=#ffffff|
gs1=#eeeeee|
gs2=#dddddd|
gs3=#cccccc|
gs4=#bbbbbb|
gs5=#aaaaaa|
#default={{{bgcolor}}}}};">{{#if:{{{title|}}}|<center><big><b>{{{title}}}</b></big></center>}}
{{{text|{{{1|'''''Error:''' Text is missing!''}}}}}}
</div></includeonly><noinclude>{{Doc|
Centered box with fixed margins for displaying material
 
'''Syntax:'''
:{{tl|DisplayBox|<displayed text>}}
 
'''Optional parameters:'''
<pre>
|marginL=<margin-left, default=30px>
|marginL=<margin-left, default=30px>
|marginR=<margin-right, default=30px>
|marginR=<margin-right, default=30px>
Line 7: Line 34:
|bdcolor=<bordercolor, default=#3399ff>
|bdcolor=<bordercolor, default=#3399ff>
|padding=<padding, default=0.4em 1em 0.4em 1em (top, right, bottom, left)>
|padding=<padding, default=0.4em 1em 0.4em 1em (top, right, bottom, left)>
|bgcolor=<backgroundcolor, default=#d8d8d8; other options include:
|bgcolor=<backgroundcolor, default=#d8d8d8;> other options include:
   grey=#dddddd
   grey=#dddddd
   char=#bbbbbb (charcoal)
   char=#bbbbbb (charcoal)
Line 18: Line 45:
   none=#ffffff (white)
   none=#ffffff (white)
   w  =#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
|text=<text to display, defaults to parameter 1 when no optional parameters are used>
-->
</pre>
<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|grey}}}|
}}
case: grey=#dddddd|
case: char=#bbbbbb|
case: none=#ffffff|
case: g=#ddffdd|
case: r=#ffdddd|
case: y=#eeeeb8|
case: b=#ddddff|
case: m=#e8d4ee|
case: o=#ffeebb|
case: w=#ffffff|
case: gs0=#ffffff|
case: gs1=#eeeeee|
case: gs2=#dddddd|
case: gs3=#cccccc|
case: gs4=#bbbbbb|
case: gs5=#aaaaaa|
default={{{bgcolor}}}}};">{{#if:{{{title|}}}|<center><big><b>{{{title}}}</b></big></center>}}
{{{text|{{{1|<displayed text>}}}}}}
</div><noinclude><br>
{{prot-temp}}
{{prot-temp}}
[[Category:Templates]]
[[Category:Message box templates]]
</noinclude>
</noinclude>

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>