<p>'''<tt>{{factions}}</tt>''' 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.<ref>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.</ref>
'''<tt><nowiki>{{factions}}</nowiki></tt>''' 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.<ref>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.</ref>
</p>
<div style="width: 90%; margin: 0 auto .2em auto; background-color:#efefef; border: 2px solid #eeeeee; padding: 2px; text-align: left;">'''Note:''' ''This template is based on an almost-identical template on [http://starwars.wikia.com/wiki/Template:Eras Wookiepedia] used to place "Era" icons in the titlebar.''</div>
<div style="width: 90%; margin: 0 auto .2em auto; background-color:#efefef; border: 2px solid #eeeeee; padding: 2px; text-align: left;">'''Note:''' ''This template is based on an almost-identical template on [http://starwars.wikia.com/wiki/Template:Eras Wookiepedia] used to place "Era" icons in the titlebar.''</div>
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.)
<p>Faction names used by this template are case-insensitive.
==Custom faction icons==
</p><p>Any mis-typed text not recognized as the template will be rendered as text. (You will notice, it's hard to miss.)
There are some characters who have their ''own'' faction symbol, (example: [[Moon (BWII)|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;
</p>
<table class="wikitable">
<tr>
<th>FACTION NAME </th><th> TEMPLATE TEXT </th><th> ICON
<p>There are some characters who have their ''own'' faction symbol, (example: [[Moon (BWII)|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;
</p>
<pre>{{factions/icons
<pre>{{factions/icons
|custom=Moon symbol clean.png -REQUIRED, filename of image
|custom=Moon symbol clean.png -REQUIRED, filename of image
Line 148:
Line 90:
|cLink=Celestial -REQUIRED, Page the image links to.
|cLink=Celestial -REQUIRED, Page the image links to.
|cPretty=Celestials -Optional, mouseover text. Will use the link if not supplied.
|cPretty=Celestials -Optional, mouseover text. Will use the link if not supplied.
}}</pre>
}}</pre>This is, in turn, included along with the other non-custom tags.
<p>This is, in turn, included along with the other non-custom tags.
</p>
<pre>{{factions
<pre>{{factions
|{{factions/icons|custom=Moon symbol clean.png|cLink=Celestial|cPretty=Celestials}}
|{{factions/icons|custom=Moon symbol clean.png|cLink=Celestial|cPretty=Celestials}}
As of this writing<sup>(Jan-16-09)</sup>, this is the only template on TFWiki 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 {{factions}} 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.''
<p>As of this writing<sup>(Jan-16-09)</sup>, this is the only template on TFWiki 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.
</p><p>As a result, the {{factions}} template doesn't HAVE to be at the page... but by convention it always ''should'' be.
</p><p>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.''
* The Javascript function associated with this template is called ''showFactions()''.
* 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 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.
Line 168:
Line 104:
* The "custom" imagemaps use "[http://www.mediawiki.org/wiki/Help:Magic_words#Miscellaneous #tag: syntax]" to allow parameters to be passed to them. (Don't think this will ever have to be edited.)
* The "custom" imagemaps use "[http://www.mediawiki.org/wiki/Help:Magic_words#Miscellaneous #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.
* The icons themselves are generated by the "[[Template:Factions/icons]]" sub-page.
* The [[Template talk:Factions|development process]] of this template included a truly ''spectacular'' recursion error that knocked the entire wiki offline as its stack overflowed, repeatedly and <small>we think</small> 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 [[User:Derik|Derik]]!'''
* The [[Template talk:Factions|development process]] of this template included a truly ''spectacular'' recursion error that knocked the entire wiki offline as its stack overflowed, repeatedly and <small>we think</small> 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 [[User:Derik|Derik]]!'''
Revision as of 01:06, 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]
Note:This template is based on an almost-identical template on Wookiepedia used to place "Era" icons in the titlebar.
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.)
FACTION NAME
TEMPLATE TEXT
ICON
Autobot
autobot
Decepticon
decepticon
Optimus
optimus
Malignus
malignus
Quintesson
quintesson
Autobot Generation 2
autobotg2
Decepticon Generation 2
decepticong2
Cybertronian Generation 2
cybEmpireG2
Maximal
maximal
Predacon
predacon
Blendtron
blendtron
blendtron
Maximal (Beast Machines)
maximalbm
Vehicon
vehicon
Dinobot
dinobot
Mutant
mutant
Predacon (Robots in Disguise)
predaconrid
Wreckers
wreckers
Mini-Con
minicon
Unicron
unicron
Velocitron
velocitron
Jungle Planet
jungleplanet
Gigantion
gigantion
ultracon
ultracon
Sector Seven
sector7
Autobot (TransTech)
ttautobot
Decepticon (TransTech)
ttdecepticon
Autobot (Shattered Glass)
sgAutobot
Decepticon (Shattered Glass)
sgDecepticon
G.I. Joe
gijoe
Cobra
cobra
EDC
edc
First Transformers
1stTF
Playskool Go-Bots
gogogobot
gogogobot
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
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
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 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.