Template:Factions/doc: Difference between revisions
| Line 34: | Line 34: | ||
|- | |- | ||
|Predacon ||predacon ||{{Factions/icons|option=predacon }} | |Predacon ||predacon ||{{Factions/icons|option=predacon }} | ||
|- | |- | ||
|Maximal (Beast Machines)||maximalbm ||{{Factions/icons|option=maximalbm }} | |Maximal (Beast Machines)||maximalbm ||{{Factions/icons|option=maximalbm }} | ||
| Line 51: | Line 49: | ||
|Mini-Con ||minicon ||{{Factions/icons|option=minicon }} | |Mini-Con ||minicon ||{{Factions/icons|option=minicon }} | ||
|- | |- | ||
|Unicron ||unicron ||{{Factions/icons|option=unicron }} | |Unicron-allied ||unicron ||{{Factions/icons|option=unicron }} | ||
|- | |||
|Unicron (faction)||unicronfact ||{{Factions/icons|option=unicronfact }} | |||
|- | |||
|Blendtron sub-group ||blendtron ||{{Factions/icons|option=blendtron }} | |||
|- | |- | ||
|Velocitron ||velocitron ||{{Factions/icons|option=velocitron }} | |Velocitron ||velocitron ||{{Factions/icons|option=velocitron }} | ||
| Line 59: | Line 61: | ||
|Gigantion ||gigantion ||{{Factions/icons|option=gigantion }} | |Gigantion ||gigantion ||{{Factions/icons|option=gigantion }} | ||
|- | |- | ||
| | |Ultracon ||ultracon ||{{Factions/icons|option=ultracon }} | ||
|- | |- | ||
|Sector Seven||sector7 ||{{Factions/icons|option=sector7 }} | |Sector Seven||sector7 ||{{Factions/icons|option=sector7 }} | ||
| Line 81: | Line 83: | ||
|Playskool Go-Bots||gogogobot ||{{Factions/icons|option=gogogobot }} | |Playskool Go-Bots||gogogobot ||{{Factions/icons|option=gogogobot }} | ||
|} | |} | ||
==Custom faction icons== | ==Custom faction icons== | ||
Revision as of 11:43, 26 March 2009
{{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]
{{factions
|autobot
|decepticon}}
Faction icon names
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.)
Custom faction icons
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
As of this writing(Jan-16-09), this is the only template on TFWiki that requires Javascript to function. The icons in question are created within a non-rendering
Technical notes
- The Javascript function associated with this template is called showFactions().
- The non-rendering has an id of "title-factionicons." There is a single CSS rule associated with this ID-- causing the <imagemap>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
- 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
- ↑ 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.































