Template:Notice: Difference between revisions

From questden
Jump to navigationJump to search
(Yeah, we've got enough of these to justify factoring out the common styling.)
 
(Make use of default image conditional on colour cue; make colour cue positioning dependent on image presence.)
Line 2: Line 2:
Creates a nice little box for some kind of notification on the article. Used for formatting things like [[Template:Stub]] and [[Template:Spoilers]]. Takes arguments:
Creates a nice little box for some kind of notification on the article. Used for formatting things like [[Template:Stub]] and [[Template:Spoilers]]. Takes arguments:
;color:Color bar to hint the box with. Defaults to no hinting. Use CSS colours, e.g. names or hash-prefixed hex.
;color:Color bar to hint the box with. Defaults to no hinting. Use CSS colours, e.g. names or hash-prefixed hex.
;image:Icon to use. Defaults to the tgchan logo.
;image:Icon to use. Defaults to the tgchan logo unless a color is specified.
;majortext:Bold, leading part of the message, e.g. "this is a stub".
;majortext:Bold, leading part of the message, e.g. "this is a stub".
;minortext:Rest of the message, e.g. "you should add stuff". Remember that you can put (most) markup in template arguments, like links.
;minortext:Rest of the message, e.g. "you should add stuff". Remember that you can put (most) markup in template arguments, like links.
Line 8: Line 8:
{| style="border:1px solid black; margin-left: auto; margin-right: auto;"
{| style="border:1px solid black; margin-left: auto; margin-right: auto;"
|-
|-
|style="{{#if:{{{color|}}}|border-right: 5mm solid {{{color}}};"|}}|[[Image:{{{image|Tgchan_logo.png}}}|40px]] '''{{{majortext|Note:}}}''' {{{minortext|}}}
|style="{{#if:{{{color|}}}|border-{{#if:{{{image|}}}|right: 5mm|left: 40px}} solid {{{color}}};"|}}|{{#if:{{{color|}}}|{{#if|{{{image|}}}|[Image:{{{image}}}|40px]|}}|[[Image:{{{image|Tgchan_logo.png}}}|40px]]}} '''{{{majortext|Note:}}}''' {{{minortext|}}}
|}
|}

Revision as of 12:47, 15 November 2010

Creates a nice little box for some kind of notification on the article. Used for formatting things like Template:Stub and Template:Spoilers. Takes arguments:

color
Color bar to hint the box with. Defaults to no hinting. Use CSS colours, e.g. names or hash-prefixed hex.
image
Icon to use. Defaults to the tgchan logo unless a color is specified.
majortext
Bold, leading part of the message, e.g. "this is a stub".
minortext
Rest of the message, e.g. "you should add stuff". Remember that you can put (most) markup in template arguments, like links.
Tgchan logo.png Note: