Template:Factions/doc: Difference between revisions

From MediaWiki
Jump to navigationJump to search
Derik (talk | contribs)
No edit summary
Derik (talk | contribs)
mNo edit summary
Line 1: Line 1:
<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>
<pre>{{factions
<pre>{{factions
|Autobot
|autobot
|Decepticon}}
|decepticon}}
</pre>
</pre>
<div id="title-factionicons" style="float: right; display: none;"><div style="position: relative;">[[Autobot|<img alt="" src="/w2/images2/thumb/f/fe/Symbol_autobot_reg.png/30px-Symbol_autobot_reg.png" width="30" height="30" border="0"/>]]</div><div style="position: relative;">[[Decepticon|<img alt="" src="/w2/images2/thumb/d/d7/Symbol_decept_reg.jpg/28px-Symbol_decept_reg.jpg" width="28" height="30" border="0"/>]]</div><div style="position: relative;">[[Predacon|<img alt="" src="/w2/images2/thumb/0/01/Predacon_symbol.png/24px-Predacon_symbol.png" width="24" height="30" border="0"/>]]</div><div style="position: relative;">[[Maximal|<img alt="" src="/w2/images2/thumb/3/33/Maximal_symbol.png/23px-Maximal_symbol.png" width="23" height="30" border="0"/>]]</div><div style="position: relative;">[[Vehicon|<img alt="" src="/w2/images2/thumb/5/58/Vehicon_symbol.png/30px-Vehicon_symbol.png" width="30" height="29" border="0"/>]]</div></div>
{{factions|autobot|decepticon}}
<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>


<ul>
==Faction icon names==
<li class="toclevel-1"><a href="#Faction_icon_names"><span class="tocnumber">1</span> <span class="toctext">Faction icon names</span></a></li>
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.)
<li class="toclevel-1"><a href="#Custom_faction_icons"><span class="tocnumber">2</span> <span class="toctext">Custom faction icons</span></a></li>
{| clsss="prettytable" border="1"
<li class="toclevel-1"><a href="#General_considerations"><span class="tocnumber">3</span> <span class="toctext">General considerations</span></a></li>
|-
<li class="toclevel-1"><a href="#Technical_notes"><span class="tocnumber">4</span> <span class="toctext">Technical notes</span></a></li>
!FACTION NAME
!TEMPLATE TEXT
!ICON
|-
|Autobot||autobot||{{Factions/icons|option=autobot}}
|-
|Decepticon||decepticon||{{Factions/icons|option=decepticon}}
|-
|Optimus ||optimus ||{{Factions/icons|option=optimus}}
|-
|Malignus ||malignus ||{{Factions/icons|option=malignus }}
|-
|Quintesson ||quintesson ||{{Factions/icons|option=quintesson }}
|-
|Autobot Generation 2||autobotg2 ||{{Factions/icons|option=autobotg2 }}
|-
|Decepticon Generation 2||decepticong2 ||{{Factions/icons|option=decepticong2 }}
|-
|Cybertronian Generation 2 ||cybEmpireG2 ||{{Factions/icons|option=cybEmpireG2 }}
|-
|Maximal ||maximal ||{{Factions/icons|option=maximal }}
|-
|Predacon ||predacon ||{{Factions/icons|option=predacon }}
|-
|Blendtron ||blendtron ||{{Factions/icons|option=blendtron }}
|-
|Maximal (Beast Machines)||maximalbm ||{{Factions/icons|option=maximalbm }}
|-
|Vehicon ||vehicon ||{{Factions/icons|option=vehicon }}
|-
|Dinobot ||dinobot ||{{Factions/icons|option=dinobot }}
|-
|Mutant ||mutant ||{{Factions/icons|option=mutant }}
|-
|Predacon (Robots in Disguise)||predaconrid ||{{Factions/icons|option=predaconrid }}
|-
|Wreckers ||wreckers ||{{Factions/icons|option=wreckers }}
|-
|Mini-Con ||minicon ||{{Factions/icons|option=minicon }}
|-
|Unicron ||unicron ||{{Factions/icons|option=unicron }}
|-
|Velocitron ||velocitron ||{{Factions/icons|option=velocitron }}
|-
|Jungle Planet ||jungleplanet ||{{Factions/icons|option=jungleplanet }}
|-
|Gigantion ||gigantion ||{{Factions/icons|option=gigantion }}
|-
|ultracon ||ultracon ||{{Factions/icons|option=ultracon }}
|-
|Sector Seven||sector7 ||{{Factions/icons|option=sector7 }}
|-
|Autobot (TransTech)||ttautobot ||{{Factions/icons|option=ttautobot }}
|-
|Decepticon (TransTech)||ttdecepticon ||{{Factions/icons|option=ttdecepticon }}
|-
|Autobot (Shattered Glass)||sgAutobot ||{{Factions/icons|option=sgAutobot }}
|-
|Decepticon (Shattered Glass)||sgDecepticon ||{{Factions/icons|option=sgDecepticon }}
|-
|G.I. Joe ||gijoe ||{{Factions/icons|option=gijoe }}
|-
|Cobra ||cobra ||{{Factions/icons|option=cobra }}
|-
|EDC ||edc ||{{Factions/icons|option=edc }}
|-
|First Transformers||1stTF ||{{Factions/icons|option=1stTF }}
|-
|Playskool Go-Bots||gogogobot ||{{Factions/icons|option=gogogobot }}
|}


<li class="toclevel-1"><a href="#Trivia"><span class="tocnumber">5</span> <span class="toctext">Trivia</span></a></li>
<li class="toclevel-1"><a href="#Footnotes"><span class="tocnumber">6</span> <span class="toctext">Footnotes</span></a></li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a name="Faction_icon_names"></a><h2><span class="editsection">[[[Template:Factions/doc|edit]]]</span> <span class="mw-headline">Faction icon names</span></h2>


<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
</th></tr>
<tr>
<th>Autobot </th><th> autobot </th><th> <div style="position: relative;">[[Autobot|<img alt="" src="/w2/images2/thumb/f/fe/Symbol_autobot_reg.png/30px-Symbol_autobot_reg.png" width="30" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Decepticon </th><th> decepticon </th><th> <div style="position: relative;">[[Decepticon|<img alt="" src="/w2/images2/thumb/d/d7/Symbol_decept_reg.jpg/28px-Symbol_decept_reg.jpg" width="28" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Optimus </th><th> optimus </th><th> <div style="position: relative;">[[Optimus|<img alt="" src="/w2/images2/thumb/7/7e/Optimus_symbol.png/28px-Optimus_symbol.png" width="28" height="29" border="0"/>]]</div>
</th></tr>
<tr>
<th>Malignus </th><th> malignus </th><th> <div style="position: relative;">[[Malignus|<img alt="" src="/w2/images2/thumb/7/7c/Malignus_symbol.png/29px-Malignus_symbol.png" width="29" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Quintesson </th><th> quintesson </th><th> <div style="position: relative;">[[Quintesson|<img alt="" src="/w2/images2/thumb/b/b0/Quintesson_symbol.png/25px-Quintesson_symbol.png" width="25" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Autobot Generation 2 </th><th> autobotg2 </th><th> <div style="position: relative;">[[Autobot|<img alt="" src="/w2/images2/thumb/0/09/Auto-g2.png/30px-Auto-g2.png" width="30" height="26" border="0"/>]]</div>
</th></tr>
<tr>
<th>Decepticon Generation 2 </th><th> decepticong2 </th><th> <div style="position: relative;">[[Decepticon|<img alt="" src="/w2/images2/thumb/a/a9/Con-g2.png/30px-Con-g2.png" width="30" height="29" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Cybertronian Generation 2 </th><th> cybEmpireG2 </th><th> <div style="position: relative;">[[Cybertronian Empire|<img alt="" src="/w2/images2/thumb/9/9f/Cybertronian.png/30px-Cybertronian.png" width="30" height="29" border="0"/>]]</div>
</th></tr>
<tr>
<th>Maximal </th><th> maximal </th><th> <div style="position: relative;">[[Maximal|<img alt="" src="/w2/images2/thumb/3/33/Maximal_symbol.png/23px-Maximal_symbol.png" width="23" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Predacon (Beast Wars)</th><th> predacon </th><th> <div style="position: relative;">[[Predacon|<img alt="" src="/w2/images2/thumb/0/01/Predacon_symbol.png/24px-Predacon_symbol.png" width="24" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Blendtron </th><th> blendtron </th><th> <div style="position: relative;">[[Blendtron|<img alt="" src="/w2/images2/thumb/c/cb/Blendtron_symbol.png/29px-Blendtron_symbol.png" width="29" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Maximal (Beast Machines) </th><th> maximalbm </th><th> <div style="position: relative;">[[Maximal|<img alt="" src="/w2/images2/thumb/5/5c/Maximal_symbol_bm.png/19px-Maximal_symbol_bm.png" width="19" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Vehicon </th><th> vehicon </th><th> <div style="position: relative;">[[Vehicon|<img alt="" src="/w2/images2/thumb/5/58/Vehicon_symbol.png/30px-Vehicon_symbol.png" width="30" height="29" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Dinobot </th><th> dinobot </th><th> <div style="position: relative;">[[Dinobot|<img alt="" src="/w2/images2/thumb/6/6e/Dinobots_symbol.png/30px-Dinobots_symbol.png" width="30" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Mutant </th><th> mutant </th><th> <div style="position: relative;">[[Filthy muties|<img alt="" src="/w2/images2/thumb/8/8b/Mutants_symbol.png/25px-Mutants_symbol.png" width="25" height="29" border="0"/>]]</div>
</th></tr>
<tr>
<th>Predacon (Robots in Disguise) </th><th> predaconrid </th><th> <div style="position: relative;">[[Predacon|<img alt="" src="/w2/images2/thumb/0/01/Predacon_symbol.png/24px-Predacon_symbol.png" width="24" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Wreckers </th><th> wreckers </th><th> <div style="position: relative;">[[Wrecker|<img alt="" src="/w2/images2/thumb/d/d8/Wreckers_symbol.png/30px-Wreckers_symbol.png" width="30" height="26" border="0"/>]]</div>
</th></tr>
<tr>
<th>Mini-Con </th><th> minicon </th><th> <div style="position: relative;">[[Mini-Con|<img alt="" src="/w2/images2/thumb/d/d5/Minicon_symbol.png/30px-Minicon_symbol.png" width="30" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Unicron </th><th> unicron </th><th> <div style="position: relative;">[[Unicron|<img alt="" src="/w2/images2/thumb/a/a8/Unicronsymbol_dwmtmte.png/30px-Unicronsymbol_dwmtmte.png" width="30" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Velocitron </th><th> velocitron </th><th> <div style="position: relative;">[[Velocitron|<img alt="" src="/w2/images2/thumb/0/05/Cyber_Key_symbol_Velocitron.png/30px-Cyber_Key_symbol_Velocitron.png" width="30" height="24" border="0"/>]]</div>
</th></tr>
<tr>
<th>Jungle Planet </th><th> jungleplanet </th><th> <div style="position: relative;">[[Jungle Planet|<img alt="" src="/w2/images2/thumb/2/23/Cyber_Key_symbol_Jungle_Planet.png/30px-Cyber_Key_symbol_Jungle_Planet.png" width="30" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Gigantion </th><th> gigantion </th><th> <div style="position: relative;">[[Gigantion|<img alt="" src="/w2/images2/thumb/1/12/Cyber_Key_symbol_Gigantion.png/30px-Cyber_Key_symbol_Gigantion.png" width="30" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Ultracon </th><th> ultracon </th><th> <div style="position: relative;">[[Ultracon|<img alt="" src="/w2/images2/thumb/4/4b/Ultracon_symbol.png/24px-Ultracon_symbol.png" width="24" height="29" border="0"/>]]</div>
</th></tr>
<tr>
<th>Sector Seven</th><th> sector7 </th><th> <div style="position: relative;">[[Sector Seven|<img alt="" src="/w2/images2/thumb/5/52/Sector7logo.png/30px-Sector7logo.png" width="30" height="24" border="0"/>]]</div>
</th></tr>
<tr>
<th>Autobot (TransTech) </th><th> ttautobot </th><th> <div style="position: relative;">[[TransTech|<img alt="" src="/w2/images2/thumb/9/92/Transtech_Autobot_symbol.png/28px-Transtech_Autobot_symbol.png" width="28" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>Decepticon (TransTech) </th><th> ttdecepticon </th><th> <div style="position: relative;">[[TransTech|<img alt="" src="/w2/images2/thumb/1/1d/Transtech_Decepticon_symbol.png/20px-Transtech_Decepticon_symbol.png" width="20" height="29" border="0"/>]]</div>
</th></tr>
<tr>
<th>Autobot (Shattered Glass) </th><th> sgAutobot </th><th> <div style="position: relative;">[[Autobot|<img alt="" src="/w2/images2/thumb/c/c4/Autobot_Shattered_Glass.png/30px-Autobot_Shattered_Glass.png" width="30" height="30" border="0"/>]]</div>
</th></tr>
<tr>
<th>Decepticon (Shattered Glass) </th><th> sgDecepticon </th><th> <div style="position: relative;">[[Decepticon|<img alt="" src="/w2/images2/thumb/3/3e/Decepticon_Shattered_Glass.png/28px-Decepticon_Shattered_Glass.png" width="28" height="30" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>G.I. Joe </th><th> gijoe </th><th> <div style="position: relative;">[[G.I. Joe|<img alt="" src="/w2/images2/thumb/5/58/Joelogo.gif/90px-Joelogo.gif" width="90" height="23" border="0"/>]]</div>
</th></tr>
<tr>
<th>Cobra </th><th> cobra </th><th> <div style="position: relative;">[[Can the world oppose deadly Eskimos?|<img alt="" src="/w2/images2/thumb/0/09/Cobralogo.gif/30px-Cobralogo.gif" width="30" height="27" border="0"/>]]</div>
</th></tr>
<tr>
<th>EDC </th><th> edc </th><th> <div style="position: relative;">[[Earth Defense Command|<img alt="" src="/w2/images2/thumb/b/b4/EDC_Symbol.png/30px-EDC_Symbol.png" width="30" height="25" border="0"/>]]</div>
 
</th></tr>
<tr>
<th>First Transformers </th><th> 1stTF </th><th> <div style="position: relative;">[[First Transformers|<img alt="" src="/w2/images2/thumb/f/f0/Myfirst_symbol.png/30px-Myfirst_symbol.png" width="30" height="26" border="0"/>]]</div>
</th></tr>
<tr>
<th>Playskool Go-Bots</th><th> gogogobot </th><th> <div style="position: relative;">[[Go GO GO-BOTS!|<img alt="" src="/w2/images2/thumb/b/b6/Playschool_Go-Bots_G.png/28px-Playschool_Go-Bots_G.png" width="28" height="30" border="0"/>]]</div>
</th></tr></table>
<a name="Custom_faction_icons"></a><h2><span class="editsection">[[[Template:Factions/doc|edit]]]</span> <span class="mw-headline">Custom faction icons</span></h2>
 
<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}}
|maximal
|maximal
}}</pre>
}}</pre>
<a name="General_considerations"></a><h2><span class="editsection">[[[Template:Factions/doc|edit]]]</span> <span class="mw-headline">General considerations</span></h2>
==General considerations==
 
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.''


</p>
==Technical notes</span>==
<a name="Technical_notes"></a><h2><span class="editsection">[[[Template:Factions/doc|edit]]]</span> <span class="mw-headline">Technical notes</span></h2>
*  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.
<a name="Trivia"></a><h2><span class="editsection">[[[Template:Factions/doc|edit]]]</span> <span class="mw-headline">Trivia</span></h2>
 
==Trivia==
*  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.
{{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.)

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 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

  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.