Difference between revisions of "Template:BaseInfoBox"

From DoomWiki.org

m (Support for inline icon styles, and some commenting)
(Add neutral gray scheme, remove tc parameter, and deprecate content argument (still eliminating from descendent templates).)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<div class="boilerplate {{#if:{{{classes|}}}|{{{classes}}}|}}" {{#if:{{{id|}}}|id="{{{id}}}"|}}  
 
<div class="boilerplate {{#if:{{{classes|}}}|{{{classes}}}|}}" {{#if:{{{id|}}}|id="{{{id}}}"|}}  
  style="{{#if:{{{width|}}}|width: {{{width}}};|}}  
+
  style="overflow: auto; max-width: 90%; {{#if:{{{width|}}}|width: {{{width}}};|}}  
 
  margin: {{#if:{{{margins|}}}|{{{margins}}}|0 auto 2em auto}};
 
  margin: {{#if:{{{margins|}}}|{{{margins}}}|0 auto 2em auto}};
 
  text-align: {{#if:{{{textalign|}}}|{{{textalign}}}|center}};
 
  text-align: {{#if:{{{textalign|}}}|{{{textalign}}}|center}};
Line 9: Line 9:
 
   | warning = #FF7777
 
   | warning = #FF7777
 
   | dead = #656565
 
   | dead = #656565
 +
  | gray = #888
 
   | parchment = #CC9
 
   | parchment = #CC9
 
   | royalblue = #79B
 
   | royalblue = #79B
 
   | easter = #79B
 
   | easter = #79B
 
   | purple = #3B005B
 
   | purple = #3B005B
 +
  | lilac = #C0B8CC
 +
  | orange = #F28500
 +
  | clearred = #C03030
 +
  | camel = #C0C090
 
   | #CC9
 
   | #CC9
 
  }};  
 
  }};  
Line 20: Line 25:
 
   | warning = #F3C3C3
 
   | warning = #F3C3C3
 
   | dead = #999
 
   | dead = #999
 +
  | gray = #DDD
 
   | parchment = #F1F1DE
 
   | parchment = #F1F1DE
 
   | royalblue = #D3E3FF
 
   | royalblue = #D3E3FF
 
   | easter = #FEF1E6
 
   | easter = #FEF1E6
 
   | purple = #DCCBEF
 
   | purple = #DCCBEF
 +
  | lilac = #F0E5FF
 +
  | orange = #F8EABA
 +
  | clearred = #FBFBFB
 +
  | camel = #F8EABA
 
   | #F1F1DE
 
   | #F1F1DE
  }};"><!--  
+
  }};"><!--
 +
Full content specified?
 +
-->{{#if:{{{fullcontent|}}}|{{{fullcontent}}}|<!--
 +
A standard content form is in use.
 
  Icon is outside content if floating
 
  Icon is outside content if floating
 
-->{{#switch: {{{iconpos}}}|none|center|left|right = {{#if:{{{icon|}}}|[[File:{{{icon}}}{{!}}{{{iconsize}}}{{!}}{{{iconpos}}}]]|}} }}<!--  
 
-->{{#switch: {{{iconpos}}}|none|center|left|right = {{#if:{{{icon|}}}|[[File:{{{icon}}}{{!}}{{{iconsize}}}{{!}}{{{iconpos}}}]]|}} }}<!--  
  Transclude an external article as content?
+
  Content is inline.
-->{{#if:{{{tc|}}}|{{{{{tc}}}}}|<!--
 
No transclusion, content is inline.
 
 
--><p class="nometa" {{#if:{{{textstyle|}}}|style="{{{textstyle}}}"|}}><!--  
 
--><p class="nometa" {{#if:{{{textstyle|}}}|style="{{{textstyle}}}"|}}><!--  
 
  Icon is inline with content if not floating
 
  Icon is inline with content if not floating
 
-->{{#switch:{{{iconpos}}}|top|text-top|super|baseline|sub|middle|text-bottom|bottom = {{#if:{{{icon|}}}|[[File:{{{icon}}}{{!}}{{{iconsize}}}{{!}}{{{iconpos}}}]]|}} }}<!--  
 
-->{{#switch:{{{iconpos}}}|top|text-top|super|baseline|sub|middle|text-bottom|bottom = {{#if:{{{icon|}}}|[[File:{{{icon}}}{{!}}{{{iconsize}}}{{!}}{{{iconpos}}}]]|}} }}<!--  
 
  Directly specified content
 
  Directly specified content
-->{{{content}}}</p>}}<div style="clear:both;"></div></div><noinclude>
+
-->{{{content}}}</p><div style="clear:both;"></div><!-- End if !fullcontent -->}}</div><noinclude>
  
 
==Documentation==
 
==Documentation==
Line 46: Line 57:
 
* {{c|classes}}: Extra CSS class(es) to apply. "boilerplate" is always applied.
 
* {{c|classes}}: Extra CSS class(es) to apply. "boilerplate" is always applied.
 
* {{c|id}}: HTML entity id to apply; default none. This should be unique per descendent template.
 
* {{c|id}}: HTML entity id to apply; default none. This should be unique per descendent template.
* {{c|width}}: CSS width to apply. Default is unspecified and will fill the article width minus the default margins.
+
* {{c|width}}: CSS width to apply. Default is unspecified and will fill the article width minus the default margins. Will not exceed 90% of article width.
 
* {{c|margins}}: CSS margins. Default: 0 auto 1.5em auto. Do '''not''' include whitespace, br tags, etc after a descendant template transclusion! Change the bottom margin instead if extra space between the box and article content is desired.
 
* {{c|margins}}: CSS margins. Default: 0 auto 1.5em auto. Do '''not''' include whitespace, br tags, etc after a descendant template transclusion! Change the bottom margin instead if extra space between the box and article content is desired.
 
* {{c|textalign}}: CSS text alignment. Default is center.
 
* {{c|textalign}}: CSS text alignment. Default is center.
Line 55: Line 66:
 
** {{c|warning}}: <span style="background: #F3C3C3; border: 1px solid #FF7777">Warning red</span>
 
** {{c|warning}}: <span style="background: #F3C3C3; border: 1px solid #FF7777">Warning red</span>
 
** {{c|dead}}: <span style="background: #999; border: 1px solid #656565">Dead gray</span>
 
** {{c|dead}}: <span style="background: #999; border: 1px solid #656565">Dead gray</span>
 +
** {{c|gray}}: <span style="background: #DDD; border: 1px solid #888">Neutral gray</span>
 
** {{c|parchment}}: <span style="background: #F1F1DE; border: 1px solid #CC9">Parchment tan</span>. This is the default.
 
** {{c|parchment}}: <span style="background: #F1F1DE; border: 1px solid #CC9">Parchment tan</span>. This is the default.
 
** {{c|royalblue}}: <span style="background: #D3E3FF; border: 1px solid #79B">Royal blue</span>
 
** {{c|royalblue}}: <span style="background: #D3E3FF; border: 1px solid #79B">Royal blue</span>
 
** {{c|easter}}: <span style="background: #FEF1E6; border: 1px solid #79B">Easter egg</span>
 
** {{c|easter}}: <span style="background: #FEF1E6; border: 1px solid #79B">Easter egg</span>
 
** {{c|purple}}: <span style="background: #DCCBEF; border: 1px solid #3B005B">Purple</span>
 
** {{c|purple}}: <span style="background: #DCCBEF; border: 1px solid #3B005B">Purple</span>
 +
** {{c|lilac}}: <span style="background: #F0E5FF; border: 1px solid #C0B8CC">Lilac</span>
 +
** {{c|orange}}: <span style="background: #F8EABA; border: 1px solid #F28500">Orange</span>
 +
** {{c|clearred}}: <span style="background: #FBFBFB; border: 1px solid #C03030">Clear Red</span>
 +
** {{c|camel}}: <span style="background: #F8EABA; border: 1px solid #C0C090">Camel</span>
 
* {{c|textstyle}}: CSS style to apply to text. Default none.
 
* {{c|textstyle}}: CSS style to apply to text. Default none.
* {{c|content}}: Place content of descendent template here.
+
* {{c|content}}: Place content of descendent template here. '''''Deprecated.''''' Use {{c|fullcontent}} instead.
* {{c|tc}}: Alternatively to use of content, specify tc to transclude the contents of another document into this template's content area.
+
* {{c|fullcontent}}: Alternatively to use of content, specify the entire contents of the infobox using this parameter.
  
[[Category:Templates]]
+
[[Category:InfoBox classes]]
 
</noinclude>
 
</noinclude>

Latest revision as of 16:13, 15 March 2015

{{{content}}}

Documentation[edit]

Base class template for article-top information boxes.

Parameters[edit]

  • icon: Name of a file to display as an icon (optional). If provided, iconpos and iconsize are required. Must be floating if tc is specified.
    • iconsize: Size of icon. Required if an icon is specified.
    • iconpos: Floating or inline position of icon. Required if an icon is specified.
  • classes: Extra CSS class(es) to apply. "boilerplate" is always applied.
  • id: HTML entity id to apply; default none. This should be unique per descendent template.
  • width: CSS width to apply. Default is unspecified and will fill the article width minus the default margins. Will not exceed 90% of article width.
  • margins: CSS margins. Default: 0 auto 1.5em auto. Do not include whitespace, br tags, etc after a descendant template transclusion! Change the bottom margin instead if extra space between the box and article content is desired.
  • textalign: CSS text alignment. Default is center.
  • padding: CSS padding inside infobox. Default: 0 1em.
  • border: CSS border styling. Default: 1px solid. Do not include color; color is determined by the colorscheme parameter.
  • colorscheme: Determines background and border color. Possible values:
    • info: Baby blue
    • warning: Warning red
    • dead: Dead gray
    • gray: Neutral gray
    • parchment: Parchment tan. This is the default.
    • royalblue: Royal blue
    • easter: Easter egg
    • purple: Purple
    • lilac: Lilac
    • orange: Orange
    • clearred: Clear Red
    • camel: Camel
  • textstyle: CSS style to apply to text. Default none.
  • content: Place content of descendent template here. Deprecated. Use fullcontent instead.
  • fullcontent: Alternatively to use of content, specify the entire contents of the infobox using this parameter.