Difference between revisions of "Template:CharacterInfo"
(Found a page on Wikipedia (https://en.wikipedia.org/wiki/Wikipedia:Conditional_tables) that shows using {{#if:}} from ParserFunctions having problems when used to hide rows like I was trying to do, so used the Plan C workaround. Hopefully it works.) |
|||
| Line 12: | Line 12: | ||
</div> | </div> | ||
}} | }} | ||
| − | {{#if: {{{aliases|}}} | + | |- {{#if: {{{aliases|}}} | | style="display: none" }} |
| − | | | + | |'''Aliases''' || {{{aliases}}} |
| − | + | |- {{#if: {{{campaign|}}} | | style="display: none" }} | |
| − | + | |'''Campaign''' || {{{campaign}}} | |
| − | |||
| − | | | ||
| − | |||
| − | |||
| − | }} | ||
|- | |- | ||
|'''Age''' || {{{age|Unknown}}} | |'''Age''' || {{{age|Unknown}}} | ||
|- | |- | ||
|'''Birthday''' || {{{birthday|Unknown}}} | |'''Birthday''' || {{{birthday|Unknown}}} | ||
| − | {{#if: {{{dateofdeath|}}} | + | |- {{#if: {{{dateofdeath|}}} | | style="display: none" }} |
| − | | | + | |'''Date of Death''' || {{{dateofdeath}}} |
| − | |||
| − | |||
| − | }} | ||
|- | |- | ||
|'''Home World''' || {{{homeworld|{{{originalworld|???}}}}}} | |'''Home World''' || {{{homeworld|{{{originalworld|???}}}}}} | ||
| − | {{#if: {{{currentworld|}}} | + | |- {{#if: {{{currentworld|}}} | | style="display: none" }} |
| − | | | + | |'''Current World''' || {{{currentworld}}} |
| − | + | |- {{#if: {{{occupation|}}} | | style="display: none" }} | |
| − | + | |'''Occupation''' || {{{occupation}}} | |
| − | |||
| − | | | ||
| − | |||
| − | |||
| − | }} | ||
|- | |- | ||
|'''Race''' || {{{race|Unknown}}} | |'''Race''' || {{{race|Unknown}}} | ||
| Line 55: | Line 42: | ||
|- | |- | ||
|'''Relatives''' || {{{relatives|None}}} | |'''Relatives''' || {{{relatives|None}}} | ||
| − | {{#if: {{{player|}}} | + | |- {{#if: {{{player|}}} | | style="display: none" }} |
| − | | | + | |'''Player''' || {{{player}}} |
| − | |||
| − | |||
| − | }} | ||
|} | |} | ||
<noinclude>This is a template for character information. | <noinclude>This is a template for character information. | ||
Revision as of 05:36, 13 January 2016
| Age | Unknown |
| Birthday | Unknown |
| Home World | ??? |
| Race | Unknown |
| Gender | Unknown |
| Height | Unknown |
| Weight | Unknown |
| Hair Color | Unknown |
| Eye Color | Unknown |
| Relatives | None |
This is a template for character information.
To utilize it, add the following to a page:
{{CharacterInfo|PARAMETERS}}
PARAMETERS is a list of items separated by the pipe symbol, |. Each parameter in the list is in the format of NAME=VALUE. The following is a list of acceptable parameters:
- name
- aliases
- campaign
- age
- birthday
- dateofdeath
- homeworld (or originalworld for backwards compatibility)
- currentworld
- occupation
- race
- gender
- height
- weight
- haircolor
- eyecolor
- relatives
- player
If any parameter is not included, then the default value will be used instead. Because the pipe symbol is used to separate items, if you wish to include the pipe symbol as a value, use | instead. The current defaults can be seen to the right, with the exceptions of Aliases, Campaign, Occupation, Current World, Date of Death and Player, which only show up if given.
In addition to the above, there are 3 additional parameters that are fields but control adding a profile image to the character information. They are as follows:
- profileurl: This is an external image URL for the profile image.
- profilesize: If given, the profile image will be locked into a maximum square of the size given (for example, 100 will max out at 100x100). If not given, it defaults to 150.
- profilecaption: If given, it will add a caption under the profile image.
Example
| Aliases | Blitz |
| Campaign | Bob and George |
| Age | Unknown |
| Birthday | Unknown |
| Birthplace | ??? |
| Current Location | Mega Man's |
| Occupation | Superhero |
| Race | Human |
| Gender | Male |
| Height | Unknown |
| Weight | Unknown |
| Hair Color | Blonde |
| Eye Color | Unknown |
| Relatives | Bob (brother) |
An example of how to use the template:
{{CharacterInfo
|profileurl=http://bobandgeorge.com/images/George.png
|profilesize=100
|profilecaption=Ice Cream
|name=George
|aliases=Blitz
|campaign=Bob and George
|occupation=Superhero
|currentworld=Mega Man's
|race=Human
|gender=Male
|haircolor=Blonde
|relatives=Bob (''brother'')
}}
This renders as (see to the right):
