Difference between revisions of "Template:Characterbox"

From LGPedia
Jump to: navigation, search
m (Made character name bold by default)
m
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<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}}}; margin-right: 0.5em;">[[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: 0em 0.5em 0em 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: 0em 0.5em 0em 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.2em 0.5em 0em 0.5em;">{{{characterblurb|''character blurb missing''}}}</p></div></includeonly><noinclude>
+
<includeonly><div style="background-color: {{{background|transparent}}}; margin-bottom: 1.5em; border: {{{border|#aaa}}} 1px solid; height:{{{height|auto}}}; width:{{{width|{{#if: {{{image|}}}|90%|100%}}}}};">{{#if: {{{image|}}}|<div style="position: relative; left: -4px; top: -4px;"><div style="float: left; border: 4px solid {{{imageborder|{{{border|#aaa}}}}}};"><div style="border: 1px solid #fff;">[[Image:{{{image}}}|{{{imagewidth|{{#if: {{{main|}}}|80|60}}}}}px|link={{ #ifexist: {{{charactername}}} | {{{charactername|}}} |}}]]</div></div></div>|}}
This template creates character boxes in variable sizes, for use on [[Characters]] and [[KM Characters]], for example.
+
<div style="background-color: {{{header|{{{background|transparent}}}}}}; margin: 0px; padding: {{#if: {{{main|}}}|0.3em 0.2em 0.2em 0.5em|0.1em 0.2em 0.1em 0.5em}}; font-weight:bold; border-bottom: 1px solid {{{border|none}}}; text-align:left;{{#if: {{{main|}}}||font-size:12px;}}">{{ #ifexist: {{{charactername}}} | '''[[{{{charactername}}}]]''' |'''{{{charactername|{{color|red|Name missing.}}}}}''' }}</div>
 +
<p style="color: {{{textcolor|#000}}}; font-size: 10px; padding: 0em 0.5em 0em 0.5em; text-align: left;">{{ #if: {{{actorname|}}} | Portrayed by: {{ #ifexist: {{{actorname}}} | [[{{{actorname}}}]] | {{{actorname|Unknown}}} }} |}}</p><p style="color: {{{textcolor|#000}}}; font-size: 11px; clear: both; padding: 0.2em 0.5em 0em 0.5em; text-align: left;">{{{characterblurb|{{color|red|'''No description entered.'''}}}}}</p></div></includeonly><noinclude>
 +
==New Characterbox template==
 +
This template creates character boxes like those on [[lonelygirl15 characters]], for example.
  
 
==Usage==
 
==Usage==
 
<pre>{{Characterbox
 
<pre>{{Characterbox
|float=
 
 
|width=
 
|width=
 
|height=
 
|height=
 
|background=
 
|background=
 
|border=
 
|border=
 +
|header=
 
|image=
 
|image=
|imageborder=
 
 
|imagewidth=
 
|imagewidth=
 +
|imageborder=
 
|charactername=
 
|charactername=
|charactername-size=
+
|textcolor=
|charactername-color=
+
 
|actorname=
 
|actorname=
|actorname-size=
 
|actorname-color=
 
 
|characterblurb=
 
|characterblurb=
|characterblurb-size=
+
 
|characterblurb-color=
+
<!--include only if a main character-->
 +
|main=yes
 
}}</pre>
 
}}</pre>
All parameters have a default value, so if a certain parameter is unneeded, it can be omitted without damage (e.g. float).
+
All parameters have a default value, so if a certain parameter is unneeded, it can be omitted without damage.
  
 
{|align="center" width="90%" cellspacing="1" cellpadding="3" style="background-color: #cecece;"
 
{|align="center" width="90%" cellspacing="1" cellpadding="3" style="background-color: #cecece;"
Line 28: Line 29:
 
!What to put there
 
!What to put there
 
!Default if omitted
 
!Default if omitted
|-style="background-color: #F5F5F5;"
 
|valign="top"|'''float'''
 
|"left" or "right", without quotes.
 
|None. If float isn't set, the box doesn't float.
 
 
|-style="background-color: #E8E8E8;"
 
|-style="background-color: #E8E8E8;"
 
|valign="top"|'''width'''
 
|valign="top"|'''width'''
|Width of the character box, in pixels, without "px".
+
|Width of the character box
|240px
+
|90%, if an image is specified, 100% otherwise
 
|-style="background-color: #F5F5F5;"
 
|-style="background-color: #F5F5F5;"
 
|valign="top"|'''height'''
 
|valign="top"|'''height'''
Line 42: Line 39:
 
|-style="background-color: #E8E8E8;"
 
|-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 &ndash; so a knowledgable person can use background images, too.</small>
+
|The box's background color. Accepts any valid HTML color name or code.
|#EEE
+
|transparent
 
|-style="background-color: #F5F5F5;"
 
|-style="background-color: #F5F5F5;"
 
|valign="top"|'''border'''
 
|valign="top"|'''border'''
|Any valid CSS border statement, in the form of ''size style color''.
+
|The box's border color. Accepts any valid HTML color name or code.
; size : Any valid size statement, e.g. "2px"
+
|#aaa
; style : Any one of: dotted, dashed, solid, double, groove, ridge, inset, outset.
+
; color : Any valid HTML color name or code.
+
|None. If omitted, there is no border.
+
 
|-style="background-color: #E8E8E8;"
 
|-style="background-color: #E8E8E8;"
 +
|valign="top"|'''header'''
 +
|The box's header color. Accepts any valid HTML color name or code.
 +
|Defaults to the background color.
 +
|-style="background-color: #F5F5F5;"
 
|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: #F5F5F5;"
 
|valign="top"|'''imageborder'''
 
|The border around the image. For input, see ''border''.
 
|None. If omitted, there is no border.
 
 
|-style="background-color: #E8E8E8;"
 
|-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.
+
|80px for main characters, 50px otherwise
 
|-style="background-color: #F5F5F5;"
 
|-style="background-color: #F5F5F5;"
 +
|valign="top"|'''imageborder'''
 +
|The border around the image. Accepts any valid HTML color name or code.
 +
|Defaults to the border color.
 +
|-style="background-color: #E8E8E8;"
 
|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''".
+
|{{color|red|'''Name missing.'''}}
|-style="background-color: #E8E8E8;"
+
|valign="top"|'''charactername-size'''
+
|The text size of the character name, in pixels, without "px".
+
|One thirteenth of the box width.
+
 
|-style="background-color: #F5F5F5;"
 
|-style="background-color: #F5F5F5;"
|valign="top"|'''charactername-color'''
+
|valign="top"|'''textcolor'''
|The text color of the character name; accepts any valid HTML color name or code.
+
|The color of text in the character box. Accepts any valid HTML color name or code.
|Black.
+
|#000
 
|-style="background-color: #E8E8E8;"
 
|-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: #F5F5F5;"
 
|valign="top"|'''actorname-size'''
 
|The text size of the actor name, in pixels, without "px".
 
|One twenty-first of the box width.
 
|-style="background-color: #E8E8E8;"
 
|valign="top"|'''actorname-color'''
 
|The text color of the actor name; accepts any valid HTML color name or code.
 
|Black.
 
 
|-style="background-color: #F5F5F5;"
 
|-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''".
+
|{{color|red|'''No description entered.'''}}
|-style="background-color: #E8E8E8;"
+
|valign="top"|'''characterblurb-size'''
+
|The text size of the character blurb, in pixels, without "px".
+
|One twentieth of the box width.
+
|-style="background-color: #F5F5F5;"
+
|valign="top"|'''characterblurb-color'''
+
|The text color of the character blurb; accepts any valid HTML color name or code.
+
|Black.
+
 
|}
 
|}
 
==Example==
 
Daniel's box from [[Characters]]:
 
<pre>{{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.
 
}}</pre>
 
{{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:
 
<pre>{{Characterbox
 
|image=0167-DanielLaughing-Cropped.JPG
 
|charactername=Daniel
 
|actorname=Yousef Abu-Taleb
 
|characterblurb=[[Bree]]'s loyal friend and budding filmmaker.
 
}}</pre>
 
{{Characterbox
 
|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
 
|actorname=Yousef Abu-Taleb
 
|characterblurb=[[Bree]]'s loyal friend and budding filmmaker.
 
}}
 
 
[[Category:Templates|{{PAGENAME}}]]</noinclude>
 
[[Category:Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 22:51, 10 April 2010

New Characterbox template

This template creates character boxes like those on lonelygirl15 characters, for example.

Usage

{{Characterbox
|width=
|height=
|background=
|border=
|header=
|image=
|imagewidth=
|imageborder=
|charactername=
|textcolor=
|actorname=
|characterblurb=

<!--include only if a main character-->
|main=yes
}}

All parameters have a default value, so if a certain parameter is unneeded, it can be omitted without damage.

Parameter What to put there Default if omitted
width Width of the character box 90%, if an image is specified, 100% otherwise
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. transparent
border The box's border color. Accepts any valid HTML color name or code. #aaa
header The box's header color. Accepts any valid HTML color name or code. Defaults to the background color.
image Purely the name of the image to use, without "Image:" prefix. None. If omitted, no image is displayed.
imagewidth The width of the image to display, in pixels, without "px". 80px for main characters, 50px otherwise
imageborder The border around the image. Accepts any valid HTML color name or code. Defaults to the border color.
charactername Purely the name of the character, nothing else. If a page with that name exists, a link will be created automatically. Name missing.
textcolor The color of text in the character box. Accepts any valid HTML color name or code. #000
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".
characterblurb Whatever you want to say about that character. No description entered.