Template:Factions/doc: Difference between revisions
m →Faction icon names: Make these sort better. |
|||
| (32 intermediate revisions by 19 users not shown) | |||
| Line 1: | Line 1: | ||
'''<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> | '''<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> | ||
<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 [ | <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 [[wikia:starwars:Template:Eras|Wookiepedia]] used to place "Era" icons in the titlebar.''</div> | ||
<pre>{{factions | <pre>{{factions | ||
|autobot | |autobot | ||
| Line 26: | Line 26: | ||
|- | |- | ||
|Quintesson ||quintesson ||{{Factions/icons|option=quintesson }} | |Quintesson ||quintesson ||{{Factions/icons|option=quintesson }} | ||
|- | |||
|War for Cybertron Quintesson ||quintessonwfc ||{{Factions/icons|option=quintessonwfc }} | |||
|- | |- | ||
|Autobot Generation 2||autobotg2 ||{{Factions/icons|option=autobotg2 }} | |Autobot Generation 2||autobotg2 ||{{Factions/icons|option=autobotg2 }} | ||
| Line 46: | Line 48: | ||
|- | |- | ||
|Mutant ||mutant ||{{Factions/icons|option=mutant }} | |Mutant ||mutant ||{{Factions/icons|option=mutant }} | ||
|- | |- | ||
|Wreckers ||wreckers ||{{Factions/icons|option=wreckers }} | |Wreckers ||wreckers ||{{Factions/icons|option=wreckers }} | ||
| Line 57: | Line 57: | ||
|Unicron (faction)||unicronfact ||{{Factions/icons|option=unicronfact }} | |Unicron (faction)||unicronfact ||{{Factions/icons|option=unicronfact }} | ||
|- | |- | ||
| | |Blentron sub-group ||blentron ||{{Factions/icons|option=blentron }} | ||
|- | |- | ||
|Velocitron ||velocitron ||{{Factions/icons|option=velocitron }} | |Velocitron ||velocitron ||{{Factions/icons|option=velocitron }} | ||
| Line 69: | Line 69: | ||
|Ultracon ||ultracon ||{{Factions/icons|option=ultracon }} | |Ultracon ||ultracon ||{{Factions/icons|option=ultracon }} | ||
|- | |- | ||
| | |Elite Guard ||eliteguard ||{{Factions/icons|option=eliteguard }} | ||
|- | |- | ||
|Sector Seven||sector7 ||{{Factions/icons|option=sector7 }} | |Sector Seven||sector7 ||{{Factions/icons|option=sector7 }} | ||
|- | |||
|Doctor Morocco||drmorocco ||{{Factions/icons|option=drmorocco }} | |||
|- | |- | ||
|Autobot (TransTech)||ttautobot ||{{Factions/icons|option=ttautobot }} | |Autobot (TransTech)||ttautobot ||{{Factions/icons|option=ttautobot }} | ||
| Line 100: | Line 102: | ||
|- | |- | ||
|NEST||NEST||{{Factions/icons|option=NEST }} | |NEST||NEST||{{Factions/icons|option=NEST }} | ||
|- | |||
|Unit:E||unite||{{Factions/icons|option=unite}} | |||
|- | |- | ||
|Kiss Players Autobot||kiss||{{Factions/icons|option=kiss }} | |Kiss Players Autobot||kiss||{{Factions/icons|option=kiss }} | ||
| Line 120: | Line 124: | ||
|- | |- | ||
|Ammonite||ammonite||{{Factions/icons|option=ammonite}} | |Ammonite||ammonite||{{Factions/icons|option=ammonite}} | ||
|- | |||
|KSI||ksi||{{Factions/icons|option=ksi}} | |||
|- | |||
|Autobird||autobird||{{Factions/icons|option=autobird}} | |||
|- | |||
|Deceptihog||deceptihog||{{Factions/icons|option=deceptihog}} | |||
|- | |||
|Functionist Council||functionist||{{Factions/icons|option=functionist}} | |||
|- | |||
|Animorph||animorph||{{Factions/icons|option=Animorph}} | |||
|- | |||
|Toys"R"Us||TRU||{{Factions/icons|option=TRU}} | |||
|- | |||
|Cybertronian Knights||knight||{{Factions/icons|option=knight}} | |||
|- | |||
|Combatron||combatron||{{Factions/icons|option=combatron}} | |||
|- | |||
|Offworlder Zone Security Administration||ozsa||{{Factions/icons|option=ozsa}} | |||
|- | |||
|Team Stunticon||teamstunticon||{{Factions/icons|option=teamstunticon}} | |||
|- | |||
|Stunticon (Prime)||primestunticon||{{Factions/icons|option=primestunticon}} | |||
|- | |||
|Ghostbusters||ghostbusters||{{Factions/icons|option=ghostbusters}} | |||
|- | |||
|Mercenary||mercenary||{{Factions/icons|option=mercenary}} | |||
|- | |||
|Primus Vanguard||primusvanguard||{{Factions/icons|option=primusvanguard}} | |||
|- | |||
|Straxus||straxus||{{Factions/icons|option=straxus}} | |||
|- | |||
|Wreckers (IDW)||wreckersidw||{{Factions/icons|option=wreckersidw}} | |||
|- | |||
|Terrorcon (ROTB)||terrorcon||{{Factions/icons|option=terrorcon}} | |||
|- | |||
|Mayhem Attack Squad||mayhem||{{Factions/icons|option=mayhem}} | |||
|- | |- | ||
|Obsolete<ref name="obsolete">These template texts are obsolete. Please use the standard "autobot" and "decepticon" texts.</ref>||autobotfilm||{{Factions/icons|option=autobotfilm}} | |Obsolete<ref name="obsolete">These template texts are obsolete. Please use the standard "autobot" and "decepticon" texts.</ref>||autobotfilm||{{Factions/icons|option=autobotfilm}} | ||
| Line 127: | Line 167: | ||
==Custom faction icons== | ==Custom faction icons== | ||
There are some characters who have their ''own'' faction symbol, (example: [[Moon ( | There are some characters who have their ''own'' faction symbol, (example: [[Moon (BW)|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; | ||
<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 139: | Line 179: | ||
}}</pre> | }}</pre> | ||
==General considerations== | ==General considerations== | ||
As of this writing<sup>( | As of this writing <sup>(Mar-28-19)</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.'' | ||
==Technical notes== | ==Technical notes== | ||
| Line 152: | Line 192: | ||
==Footnotes== | ==Footnotes== | ||
<references/> | <references/><noinclude>[[Category:Externalized documentation]]</noinclude> | ||
<noinclude>[[Category: Externalized documentation]]</noinclude> | |||
Latest revision as of 22:23, 22 October 2024
{{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
[edit]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 | |
| Decepticon | decepticon | |
| Optimus | optimus | |
| Malignus | malignus | |
| Quintesson | quintesson | |
| War for Cybertron Quintesson | quintessonwfc | |
| Autobot Generation 2 | autobotg2 | |
| Decepticon Generation 2 | decepticong2 | |
| Cybertronian Generation 2 | cybEmpireG2 | |
| Cybertron Alliance | allianceg2 | |
| Maximal | maximal | |
| Predacon | predacon | |
| Maximal (Beast Machines) | maximalbm | |
| Vehicon | vehicon | |
| Dinobot | dinobot | |
| Mutant | mutant | |
| Wreckers | wreckers | |
| Mini-Con | minicon | |
| Unicron-allied | unicron | |
| Unicron (faction) | unicronfact | |
| Blentron sub-group | blentron | |
| Velocitron | velocitron | |
| Jungle Planet | jungleplanet | |
| Earth | cybearth | |
| Gigantion | gigantion | |
| Ultracon | ultracon | |
| Elite Guard | eliteguard | |
| Sector Seven | sector7 | |
| Doctor Morocco | drmorocco | |
| 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 | |
| Go-Bots | go-bot1 | |
| Go-Bots | go-bot2 | |
| Galactic Republic | galacticrepublic | |
| Rebel Alliance | rebelalliance | |
| Empire | empire | |
| NEST | NEST | |
| Unit:E | unite | |
| Kiss Players Autobot | kiss | |
| Kiss Players Decepticon | kisscon | |
| Protectors | protectors | |
| Hall of Fame inductees (real-life) | hofgold | |
| Hall of Fame inductees (characters) | hofsilver | |
| Star Seekers | starseeker | |
| Lightning Strike Coalition | lightningstrike | |
| Predacon (Prime) | predaconprime | |
| Rescue Bots | rescuebot | |
| Ammonite | ammonite | |
| KSI | ksi | |
| Autobird | autobird | |
| Deceptihog | deceptihog | |
| Functionist Council | functionist | |
| Animorph | animorph | |
| Toys"R"Us | TRU | |
| Cybertronian Knights | knight | |
| Combatron | combatron | |
| Offworlder Zone Security Administration | ozsa | |
| Team Stunticon | teamstunticon | |
| Stunticon (Prime) | primestunticon | |
| Ghostbusters | ghostbusters | |
| Mercenary | mercenary | |
| Primus Vanguard | primusvanguard | |
| Straxus | straxus | |
| Wreckers (IDW) | wreckersidw | |
| Terrorcon (ROTB) | terrorcon | |
| Mayhem Attack Squad | mayhem | |
| Obsolete[2] | autobotfilm | |
| Obsolete[2] | decepticonfilm |
Custom faction icons
[edit]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]As of this writing (Mar-28-19) 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
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]- 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]- 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]- ↑ 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.
- ↑ 2.0 2.1 These template texts are obsolete. Please use the standard "autobot" and "decepticon" texts.







































































