Template:Userbox Server: Difference between revisions

From Unofficial Homecoming Wiki
Jump to navigation Jump to search
imported>Konoko
m (learned about default in templates.)
imported>Konoko
m (programming update.)
Line 1: Line 1:
<div style="float: left; border: solid #4169E1 1px; margin: 1px;">
<div style="float: left; border: solid #4169E1 1px; margin: 1px;">
{| cellspacing="0" style="width: 238px; color: #000000; background: #D3D3D3;"
{| cellspacing="0" style="width: 238px; color: #000000; background: #D3D3D3;"
| style="width: 45px; height: 45px; background: white; text-align: center;" | {{{3|{{#ifeq: {{{1}}} | Heroes | [[Image:Badge defeatstatesman.png|32px]] | {{#ifeq: {{{1}}} | Villains | [[Image:Badge defeatrecluse.png|32px]] | [[Image:Power_Missing.png]] }} }} }}}
| style="width: 45px; height: 45px; background: white; text-align: center;" | {{{3|{{#switch: {{lc:{{{1}}}}}
| style="font-size: 8pt; padding: 4pt; line-height: 1.25em;" | This user plays City of {{{1}}} on the '''<font style="font-weight:bold;">[[Servers|{{{2}}}]]</font>''' server.
| h
| coh
| hero
| heroes = [[Image:CoH Game Icon.png|32px]]
| cov
| v
| villain
| villains = [[Image:CoV Game Icon.png|32px]]
| vh
| both
| cohv
| coh/v
| cox
| hv = [[Image:CoX Game Icon.png|32px]]
| #default = [[Image:Power Missing.png]]}}}}}
| style="font-size: 8pt; padding: 4pt; line-height: 1.25em;" | This user plays {{#switch: {{lc:{{{1}}}}}
| h
| coh
| hero
| heroes = City of Heroes
| cov
| v
| villain
| villains = City of Villains
| vh = both City of Villains and Heroes
| both
| cohv
| coh/v
| cox
| hv
| #default = both City of Heroes and Villains}} on the '''<font style="font-weight:bold;">[[Servers|{{{2}}}]]</font>''' server.
|}</div><noinclude>
|}</div><noinclude>
{{clr}}
{{clr}}
==Usage==
==Usage==
Three parameters
Three parameters
* first is the game, either '''Heroes''' or '''Villains'''
* first is the game
** most variants of Heroes, CoH, Villains, COHV will be replaced with "City of Heroes" or "City of Villains" or "City of Heroes/Villains".
** Other words will replace "City of" with that word.
* second is the server.
* second is the server.
** no matter which server is entered, always links to the [[Servers]] article. ''Will be updated with a #switch statement to only link to Servers if the one specified is a valid CoX server''
* the third parameter is optional. if specified, will replace the image with the one specified.
* the third parameter is optional. if specified, will replace the image with the one specified.
: If the first paramter does not match Heroes or Villians, a 'default' image will be displayed, unless replaced by this third parameter.
** If the first paramter does not match Heroes or Villains, a 'default' image will be displayed, unless replaced by this third parameter.
:* '''<nowiki>{{#if: {{{3|}}} | {{{3}}}</nowiki>'''
* Both the first and third parameters use the same #switch statement to replace text/images.
:*: ''If third parameter exists, then display the third paratmeter''
== Example ==
:** '''<nowiki> | {{#ifeq: {{{1}}} | Heroes | [[Image:Badge defeatstatesman.png|32px]] </nowiki>'''
:**: ''if third parameter does not exist, attempt to replace with a default 'hero' icon, based on first parameter''
:*** '''<nowiki> | {{#ifeq: {{{1}}} | Villains | [[Image:Badge defeatrecluse.png|32px]]</nowiki>'''
:***: ''if not heroes, try villains''
:**** '''<nowiki> | [[Image:Power_Missing.png]]</nowiki>'''
:****: ''if all else fails, display the missing icon (replace with paragon wiki icon?!?)''
:***** '''<nowiki> }} }} }}</nowiki>'''
:*****: ''close all three if statements''
----
{|
{|
|-
|-

Revision as of 09:05, 8 July 2007

Power Missing.png This user plays both City of Heroes and Villains on the {{{2}}} server.


Usage

Three parameters

  • first is the game
    • most variants of Heroes, CoH, Villains, COHV will be replaced with "City of Heroes" or "City of Villains" or "City of Heroes/Villains".
    • Other words will replace "City of" with that word.
  • second is the server.
    • no matter which server is entered, always links to the Servers article. Will be updated with a #switch statement to only link to Servers if the one specified is a valid CoX server
  • the third parameter is optional. if specified, will replace the image with the one specified.
    • If the first paramter does not match Heroes or Villains, a 'default' image will be displayed, unless replaced by this third parameter.
  • Both the first and third parameters use the same #switch statement to replace text/images.

Example

{{Userbox Server|Heroes|Champion}}
CoH Game Icon.png This user plays City of Heroes on the Champion server.
{{Userbox Server|Villains|Virtue}}
CoV Game Icon.png This user plays City of Villains on the Virtue server.
{{Userbox Server|Villains|Freedom|[[Image:Skill power invent.png]]}}
Skill power invent.png This user plays City of Villains on the Freedom server.
{{Userbox Server|Moonmen|Pinnacle}}
Power Missing.png This user plays both City of Heroes and Villains on the Pinnacle server.
{{Userbox Server|Zeroes|Elysium|[[Image:ArcticMastery BlockOfIce.png]]}}
ArcticMastery BlockOfIce.png This user plays both City of Heroes and Villains on the Elysium server.