Template:DisplayBox: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(convert to #switch: parserfunction, add more colors)
(replaced template:Switch with parser function #switch)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- box 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>
|marginB=<margin-bottom, default=0>
|marginT=<margin-top, default=0>
|bdwidth=<borderwidth in pixels, default=1>  
|bdwidth=<borderwidth in pixels, default=1>  
|bdcolor=<bordercolor, default=#3399ff>
|bdcolor=<bordercolor, default=#3399ff>
|padding=<padding, default=1em 1em 1em 1em (top, right, bottom, left)>
|padding=<padding, default=0.4em 1em 0.4em 1em (top, right, bottom, left)>
|bgcolor=<backgroundcolor, default=#ddddd (grey); other options described in code below>
|bgcolor=<backgroundcolor, default=#d8d8d8;> other options include:
|text=<text to display, defaults to parameter 1 when no optional parameters are used
  grey=#dddddd
-->
  char=#bbbbbb (charcoal)
<div style="margin: 0; margin-right: {{{marginR|30px}}}; margin-left: {{{marginL|30px}}}; border:{{{bdwidth|1}}}px solid {{{bdcolor|#3399ff}}}; padding: {{{padding|1em 1em 1em 1em}}}; background-color:{{#switch:
  g   =#ddffdd (green)
{{{bgcolor|grey}}}
  r   =#ffdddd (red)
|gray
  y   =#ffffbb (yellow)
|grey=#dddddd
  b   =#ddddff (blue)
|dkgray
  m   =#ddccff (magenta)
|dkgrey=#bbbbbb
  o  =#ffeebb (orange)
|white
  none=#ffffff (white)
|w
  w  =#ffffff (white)
|wh
|title=<optional; a centered title displayed in bold>
|none=#ffffff
|text=<text to display, defaults to parameter 1 when no optional parameters are used>
|offwhite=#ffffee
</pre>
|green
}}
|g=#ddffdd
|brgreen=#99ff99
|red
|r=#ffdddd
|brred=#ff9999
|yellow
|y=#ffffbb
|bryellow=#ffff99
|blue
|b=#ddddff
|brblue=#9999ff
|magenta
|m=#ddccff
|brmagenta=#cc99ff
|orange
|o=#ffeebb
|brorange=#ffcc99
|{{bgcolor}}}};">{{{text|{{{1|<displayed text>}}}}}}</div><noinclude><br>
{{prot-temp}}
{{prot-temp}}
[[Category:Templates|{{PAGENAME}}]]
[[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>