Name – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
(Specifically for use in {{Command}} and {{Function}} to fix imperfect additions. Will act to replace multiple templates and provide greater functionality and ease of maintenance. >> Needs peer review of short and long game names please <<)
 
(Correcting case for TKOH and TKOM which contrary to apparently all other short names, should be upper case.)
Line 29: Line 29:
|vbs 2=vbs2
|vbs 2=vbs2
|tkoh
|tkoh
|toh=tkoh
|toh=TKOH
|tkom
|tkom
|tom=tkom
|tom=TKOM
|#default=arma}}|{{#if:{{{long|}}}|{{#switch:{{lc:{{{long}}}}}
|#default=arma}}|{{#if:{{{long|}}}|{{#switch:{{lc:{{{long}}}}}
|arma
|arma
Line 72: Line 72:
Can be expanded to suit future and possible present needs, not currently included ''i.e.'' returning correctly formatted correct case short names like "''Arma 2:OA''" etc.
Can be expanded to suit future and possible present needs, not currently included ''i.e.'' returning correctly formatted correct case short names like "''Arma 2:OA''" etc.


Please add any cases omitted, or if unsure about how to do it, leave a message on [[Template talk:Game name|the talk page]].}}
Please add any switch cases omitted, or if unsure about how to do it, leave a message on [[Template talk:Game name|the talk page]].}}
==Usage==
==Usage==
Takes one parameter in the form of either <tt>short=name</tt>, which returns the correct short name in lower case.
Takes one parameter in the form of either <tt>short=name</tt>, which returns the correct short name in lower case.
Line 80: Line 80:
Returns the correct game name, even if the input isn't correct.
Returns the correct game name, even if the input isn't correct.


''i.e.'' {{Inline code|<nowiki>{{Game name|long=TOH}}</nowiki>}} will return "{{Game name|long=TOH}}" even though the input should have been "tkoh".
''i.e.'' {{Inline code|<nowiki>{{Game name|long=toh}}</nowiki>}} will return "{{Game name|long=toh}}" even though the input should have been "TKOH".
:And
:And
{{Inline code|<nowiki>{{Game name|short=ArmA 2: OA}}</nowiki>}} will return "{{Game name|short=ArmA 2: OA}}".
{{Inline code|<nowiki>{{Game name|short=ArmA 2: OA}}</nowiki>}} will return "{{Game name|short=ArmA 2: OA}}".


[[Category:Templates|{{uc:{{PAGENAME}} }}]]</noinclude>
[[Category:Templates|{{uc:{{PAGENAME}} }}]]</noinclude>

Revision as of 04:59, 29 April 2014

Not currently in use. Awaiting peer review and feedback, before including in {{Command}} and {{Function}} to correct badly formed entries.

Eventually this should replace multiple templates, providing a simple way to organise game naming convention.

Can be expanded to suit future and possible present needs, not currently included i.e. returning correctly formatted correct case short names like "Arma 2:OA" etc.

Please add any switch cases omitted, or if unsure about how to do it, leave a message on the talk page.

Usage

Takes one parameter in the form of either short=name, which returns the correct short name in lower case.

Or

long=name, which returns the correct long name in correct case.

And

Returns the correct game name, even if the input isn't correct.

i.e. {{Game name|long=toh}} will return "Template:Game name" even though the input should have been "TKOH".

And

{{Game name|short=ArmA 2: OA}} will return "Template:Game name".