Difference between revisions of "Template:Characterbox"
From LGPedia
					
										
					
					 (Test save to catch problems. THIS WILL BREAK ALL CURRENT CHARACTERBOXES.)  | 
				 (A series of tweaks and fixes)  | 
				||
| Line 1: | Line 1: | ||
| − | <includeonly><div style="float: {{{float|none}}}; width: {{{width|240}}}px; background: {{{background|transparent}}}; border: {{{border|none}}};">{{ #if: {{{image|}}} | <div style="float: left; border: {{{imageborder|none}}};   | + | <includeonly><div style="float: {{{float|none}}}; width: {{{width|240}}}px; height: {{{height|auto}}}; overflow: visible; background: {{{background|transparent}}}; border: {{{border|none}}};">{{ #if: {{{image|}}} | <div style="float: left; border-right: {{{imageborder|none}}}; border-bottom: {{{imageborder|none}}};">[[Image:{{{image}}}|{{{imagewidth|{{ #expr: {{{width|240}}}/2 }}}}}px]]</div> | }}<p style="color: {{{charactername-color|Black}}}; font-size: {{{charactername-size|{{ #expr: {{{width|240}}}/13 }}}}}px; padding: 0.5em;">{{ #ifexist: {{{charactername}}} | [[{{{charactername}}}]] |{{{charactername|''character's name''}}} }}</p><p style="color: {{{actorname-color|Black}}}; font-size: {{{actorname-size|{{ #expr: {{{width|240}}}/21 }}}}}px; padding: 0.5em;">{{ #if: {{{actorname|}}} | Portrayed by: {{ #ifexist: {{{actorname}}} | [[{{{actorname}}}]] | {{{actorname|Unknown}}} }} |}}</p><p style="color: {{{characterblurb-color|Black}}}; font-size: {{{characterblurb-size|{{ #expr: {{{width|240}}}/20 }}}}}px; clear: both; padding: 0.5em;">{{{characterblurb|''character blurb missing''}}}</p></div></includeonly><noinclude>  | 
| − | This template creates character boxes in variable sizes, for use on [[Characters]] and [[  | + | This template creates character boxes in variable sizes, for use on [[Characters]] and [[KM Characters]], for example.  | 
==Usage==  | ==Usage==  | ||
| Line 6: | Line 6: | ||
|float=  | |float=  | ||
|width=  | |width=  | ||
| + | |height=  | ||
|background=  | |background=  | ||
|border=  | |border=  | ||
| Line 36: | Line 37: | ||
|240px  | |240px  | ||
|-style="background-color: #F5F5F5;"  | |-style="background-color: #F5F5F5;"  | ||
| + | |valign="top"|'''height'''  | ||
| + | |Height of the character box, any valid css unit.  | ||
| + | |If omitted, height is automatically determined  | ||
| + | |-style="background-color: #E8E8E8;"  | ||
|valign="top"|'''background'''  | |valign="top"|'''background'''  | ||
|The box's background color. Accepts any valid HTML color name or code. <br><small>'''Note:''' In fact, this accepts any valid CSS background statement – so a knowledgable person can use background images, too.</small>  | |The box's background color. Accepts any valid HTML color name or code. <br><small>'''Note:''' In fact, this accepts any valid CSS background statement – so a knowledgable person can use background images, too.</small>  | ||
|#EEE  | |#EEE  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #F5F5F5;"  | 
|valign="top"|'''border'''  | |valign="top"|'''border'''  | ||
|Any valid CSS border statement, in the form of ''size style color''.  | |Any valid CSS border statement, in the form of ''size style color''.  | ||
| Line 46: | Line 51: | ||
; color : Any valid HTML color name or code.  | ; color : Any valid HTML color name or code.  | ||
|None. If omitted, there is no border.  | |None. If omitted, there is no border.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #E8E8E8;"  | 
|valign="top"|'''image'''  | |valign="top"|'''image'''  | ||
|Purely the name of the image to use, without "Image:" prefix.  | |Purely the name of the image to use, without "Image:" prefix.  | ||
|None. If omitted, no image is displayed.  | |None. If omitted, no image is displayed.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #F5F5F5;"  | 
|valign="top"|'''imageborder'''  | |valign="top"|'''imageborder'''  | ||
|The border around the image. For input, see ''border''.  | |The border around the image. For input, see ''border''.  | ||
|None. If omitted, there is no border.  | |None. If omitted, there is no border.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #E8E8E8;"  | 
|valign="top"|'''imagewidth'''  | |valign="top"|'''imagewidth'''  | ||
|The width of the image to display, in pixels, without "px".  | |The width of the image to display, in pixels, without "px".  | ||
|Half of the box's width.  | |Half of the box's width.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #F5F5F5;"  | 
|valign="top"|'''charactername'''  | |valign="top"|'''charactername'''  | ||
|Purely the name of the character, nothing else. If a page with that name exists, a link will be created automatically.  | |Purely the name of the character, nothing else. If a page with that name exists, a link will be created automatically.  | ||
|The text "''character's name''".  | |The text "''character's name''".  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #E8E8E8;"  | 
|valign="top"|'''charactername-size'''  | |valign="top"|'''charactername-size'''  | ||
|The text size of the character name, in pixels, without "px".  | |The text size of the character name, in pixels, without "px".  | ||
|One thirteenth of the box width.  | |One thirteenth of the box width.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #F5F5F5;"  | 
|valign="top"|'''charactername-color'''  | |valign="top"|'''charactername-color'''  | ||
|The text color of the character name; accepts any valid HTML color name or code.  | |The text color of the character name; accepts any valid HTML color name or code.  | ||
|Black.  | |Black.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #E8E8E8;"  | 
|valign="top"|'''actorname'''  | |valign="top"|'''actorname'''  | ||
|Purely the name of the actor, nothing else. If a page with that name exists, a link will be created automatically.  | |Purely the name of the actor, nothing else. If a page with that name exists, a link will be created automatically.  | ||
|The text "Unknown".  | |The text "Unknown".  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #F5F5F5;"  | 
|valign="top"|'''actorname-size'''  | |valign="top"|'''actorname-size'''  | ||
|The text size of the actor name, in pixels, without "px".  | |The text size of the actor name, in pixels, without "px".  | ||
| − | |One twenty-  | + | |One twenty-first of the box width.  | 
| − | |-style="background-color: #  | + | |-style="background-color: #E8E8E8;"  | 
|valign="top"|'''actorname-color'''  | |valign="top"|'''actorname-color'''  | ||
|The text color of the actor name; accepts any valid HTML color name or code.  | |The text color of the actor name; accepts any valid HTML color name or code.  | ||
|Black.  | |Black.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #F5F5F5;"  | 
|valign="top"|'''characterblurb'''  | |valign="top"|'''characterblurb'''  | ||
|Whatever you want to say about that character.  | |Whatever you want to say about that character.  | ||
|The text "''character blurb missing''".  | |The text "''character blurb missing''".  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #E8E8E8;"  | 
|valign="top"|'''characterblurb-size'''  | |valign="top"|'''characterblurb-size'''  | ||
|The text size of the character blurb, in pixels, without "px".  | |The text size of the character blurb, in pixels, without "px".  | ||
|One twentieth of the box width.  | |One twentieth of the box width.  | ||
| − | |-style="background-color: #  | + | |-style="background-color: #F5F5F5;"  | 
|valign="top"|'''characterblurb-color'''  | |valign="top"|'''characterblurb-color'''  | ||
|The text color of the character blurb; accepts any valid HTML color name or code.  | |The text color of the character blurb; accepts any valid HTML color name or code.  | ||
| Line 132: | Line 137: | ||
|characterblurb=[[Bree]]'s loyal friend and budding filmmaker.  | |characterblurb=[[Bree]]'s loyal friend and budding filmmaker.  | ||
}}  | }}  | ||
| − | + | The minimalist version:  | |
<pre>{{Characterbox  | <pre>{{Characterbox  | ||
|image=0167-DanielLaughing-Cropped.JPG  | |image=0167-DanielLaughing-Cropped.JPG  | ||
| Line 141: | Line 146: | ||
{{Characterbox  | {{Characterbox  | ||
|image=0167-DanielLaughing-Cropped.JPG  | |image=0167-DanielLaughing-Cropped.JPG  | ||
| + | |charactername=Daniel  | ||
| + | |actorname=Yousef Abu-Taleb  | ||
| + | |characterblurb=[[Bree]]'s loyal friend and budding filmmaker.  | ||
| + | }}  | ||
| + | A micro-box:  | ||
| + | <pre>{{Characterbox  | ||
| + | |width=180  | ||
| + | |border=1px solid MidnightBlue  | ||
| + | |charactername=Daniel  | ||
| + | |actorname=Yousef Abu-Taleb  | ||
| + | |characterblurb=[[Bree]]'s loyal friend and budding filmmaker.  | ||
| + | }}</pre>  | ||
| + | {{Characterbox  | ||
| + | |width=180  | ||
| + | |border=1px solid MidnightBlue  | ||
|charactername=Daniel  | |charactername=Daniel  | ||
|actorname=Yousef Abu-Taleb  | |actorname=Yousef Abu-Taleb  | ||
Revision as of 04:22, 13 September 2007
This template creates character boxes in variable sizes, for use on Characters and KM Characters, for example.
Usage
{{Characterbox
|float=
|width=
|height=
|background=
|border=
|image=
|imageborder=
|imagewidth=
|charactername=
|charactername-size=
|charactername-color=
|actorname=
|actorname-size=
|actorname-color=
|characterblurb=
|characterblurb-size=
|characterblurb-color=
}}
All parameters have a default value, so if a certain parameter is unneeded, it can be omitted without damage (e.g. float).
| Parameter | What to put there | Default if omitted | 
|---|---|---|
| float | "left" or "right", without quotes. | None. If float isn't set, the box doesn't float. | 
| width | Width of the character box, in pixels, without "px". | 240px | 
| height | Height of the character box, any valid css unit. | If omitted, height is automatically determined | 
| background | The box's background color. Accepts any valid HTML color name or code.  Note: In fact, this accepts any valid CSS background statement – so a knowledgable person can use background images, too.  | 
#EEE | 
| border | Any valid CSS border statement, in the form of size style color.
  | 
None. If omitted, there is no border. | 
| image | Purely the name of the image to use, without "Image:" prefix. | None. If omitted, no image is displayed. | 
| imageborder | The border around the image. For input, see border. | None. If omitted, there is no border. | 
| imagewidth | The width of the image to display, in pixels, without "px". | Half of the box's width. | 
| charactername | Purely the name of the character, nothing else. If a page with that name exists, a link will be created automatically. | The text "character's name". | 
| charactername-size | The text size of the character name, in pixels, without "px". | One thirteenth of the box width. | 
| charactername-color | The text color of the character name; accepts any valid HTML color name or code. | Black. | 
| actorname | Purely the name of the actor, nothing else. If a page with that name exists, a link will be created automatically. | The text "Unknown". | 
| actorname-size | The text size of the actor name, in pixels, without "px". | One twenty-first of the box width. | 
| actorname-color | The text color of the actor name; accepts any valid HTML color name or code. | Black. | 
| characterblurb | Whatever you want to say about that character. | The text "character blurb missing". | 
| characterblurb-size | The text size of the character blurb, in pixels, without "px". | One twentieth of the box width. | 
| characterblurb-color | The text color of the character blurb; accepts any valid HTML color name or code. | Black. | 
Example
Daniel's box from Characters:
{{Characterbox
|width=240
|background=#f5faff
|border=2px solid MidnightBlue
|image=0167-DanielLaughing-Cropped.JPG
|imageborder=1px solid MidnightBlue
|imagewidth=120
|charactername-size=18
|charactername-color=black
|charactername=Daniel
|actorname-size=11
|actorname-color=black
|actorname=Yousef Abu-Taleb
|characterblurb-size=12
|characterblurb-color=black
|characterblurb=[[Bree]]'s loyal friend and budding filmmaker.
}}
The minimalist version:
{{Characterbox
|image=0167-DanielLaughing-Cropped.JPG
|charactername=Daniel
|actorname=Yousef Abu-Taleb
|characterblurb=[[Bree]]'s loyal friend and budding filmmaker.
}}
A micro-box:
{{Characterbox
|width=180
|border=1px solid MidnightBlue
|charactername=Daniel
|actorname=Yousef Abu-Taleb
|characterblurb=[[Bree]]'s loyal friend and budding filmmaker.
}}