Template:Factions/doc

From IDW Hasbro Wiki
Jump to navigationJump to search

{{factions}} creates a small 30x30 clickable icon of a character's faction symbol to the right of the page title. Up to 10 icons can be created this way.[1]

Note: This template is based on an almost-identical template on Wookiepedia used to place "Era" icons in the titlebar.
{{factions
|autobot
|decepticon}}

Faction icon names[edit source]

Faction names used by this template are lowercase. Any mis-typed text not recognized as the template will be rendered as text. (You will notice, it's hard to miss.)

To add additional names, first edit {{Factions/icons}} using the syntax described there, then add to this list.

FACTION NAME TEMPLATE TEXT ICON
Autobot autobot
Symbol autobot reg.png
Decepticon decepticon
Symbol decept reg.png
Skywatch skywatch
Skywatch Logo.png
G.I. Joe gijoe
Joelogo.png
Cobra cobra
Cobralogo.png
Arashikage arashikage
Arashikage symbol.png
Dreadnoks dreadnoks
Dreadnoks insignia.png
Doctor X drx
Dr X logo.png
EDC edc
EDC Symbol.png
M.A.S.K. mask
MASK logo.png
Adventure Team at
At logo.png
V.E.N.O.M. venom
VENOM logo.png
Action Man Programme actionman
Action Man insignia.png
Jem and the Holograms jem
JemLogo.png
The Misfits misfits
TheMisfitsLogo.png
Spectral Knights spectralknight
SpectralKnightsSymbol.png
Darkling Lords darklinglord
DarklingLordsSymbol.png

Custom faction icons[edit source]

There are some characters who have their own faction symbol, (example: Moon) essentially used nowhere else. Rather than clutter the template with these, it is possible to declare a custom faction icon via the following format;

{{factions/icons
|custom=Moon symbol clean.png     -REQUIRED, filename of image
|cSize=30x30px     -Optional, maximum size of image.
|cLink=Celestial     -REQUIRED, Page the image links to.
|cPretty=Celestials     -Optional, mouseover text.  Will use the link if not supplied.
}}

This is, in turn, included along with the other non-custom tags.

{{factions
|{{factions/icons|custom=Moon symbol clean.png|cLink=Celestial|cPretty=Celestials}}
|maximal
}}

General considerations[edit source]

As of this writing(Jan-16-09), this is the only template on IDW Hasbro Wiki that requires Javascript to function. The icons in question are created within a non-rendering <div> tag, which is then copied into the titlebar when the page finishes loading. As a result, the

template doesn't HAVE to be at the page... but by convention it always should be.Between 0.5 - 1.0% of internet surfers have either disabled Javascript or access the internet in a way that does not support it. Those users will not be able to see these faction icons. These faction icons are intended to serve as a convenient visual shorthand for information already in the article, and are not a primary means of communicating that information. Any information presented by these icons should also be present in the article text.

Technical notes[edit source]

  • The Javascript function associated with this template is called showFactions().
  • The non-rendering <div> has an id of "title-factionicons." There is a single CSS rule associated with this ID-- causing the <imagemap> <div>s to render inline rather than as blocks.
  • The "custom" imagemaps use "#tag: syntax" to allow parameters to be passed to them. (Don't think this will ever have to be edited.)
  • The icons themselves are generated by the "Template:Factions/icons" sub-page.

Trivia[edit source]

  • The development process of this template included a truly spectacular recursion error that knocked the entire wiki offline as its stack overflowed, repeatedly and we think corrupted link-table entries that couldn't be resolved without deleting the whole thing and starting from scratch. That is why the current version of the template exists in a 'dumb' (non-recursive) form. Bad Derik!'

Footnotes[edit source]

  1. 10 is an arbitrary number. Arbitrary-length MediaWiki templates like this are generally encouraged to have no more than 20 parameters though. And really... if a character has more than 10 factions, the icons cease to communicate information and simply become noise.