Template:Class: Difference between revisions

m
no edit summary
(Moving ShipClass template testing to new page. Maybe deleted later.)
 
mNo edit summary
 
(32 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{#ifeq:{{{3|}}}|{{{3|u}}}|
<includeonly>{{#ifeq:{{{3|}}}
  {{#ifeq:{{{3|}}}| |
|{{{3|u}}}
    [[{{{1}}}-class {{{2}}}|''{{{1}}}''-class]]|
|{{#if:{{{3|}}}
    [[{{{1}}}-class {{{2}}}|''{{{1}}}''-class {{{3}}}]]
  |[[{{{1}}}-class {{{2}}}|''{{{1}}}''-class {{{3}}}]]
   }}|
  |[[{{{1}}}-class {{{2}}}|''{{{1}}}''-class]]
  [[{{{1}}}-class {{{2}}}|''{{{1}}}''-class {{{2}}}]]
   }}
}}
|[[{{{1}}}-class {{{2}}}|''{{{1}}}''-class {{{2}}}]]
<noinclude>
}}</includeonly><noinclude>
==Purpose==
==Purpose==
To avoid having to enter the following code to achieve the proper link and italics:
To avoid having to enter the following code to achieve the proper link and italics:


Code: <nowiki>[[CCS-class Battlecruiser|''CCS''-class Battlecruiser]]</nowiki><br />
Code: '''<nowiki>{{Class|Halcyon|light cruiser}}</nowiki>'''
Result: [[CCS-class Battlecruiser|''CCS''-class Battlecruiser]]
 
Result: {{Class|Halcyon|light cruiser}}


==Usage==
==Usage==
Most cases we want to provide a direct link to the article with the minimum of fuss.
Most cases we want to provide a direct link to the article with the minimum of fuss.


Code: <nowiki>{{ShipClass|CCS|Battlecruiser}}</nowiki><br />
Code: '''<nowiki>{{Class|Halcyon|light cruiser}}</nowiki>'''
Result: {{ShipClass|CCS|Battlecruiser}}
 
Result: {{Class|Halcyon|light cruiser}}


Sometimes, we don't want to use the ship's ''type'' as the follow on text.
Sometimes, we don't want to use the ship's ''type'' as the follow on text.


Code: <nowiki>{{ShipClass|CCS|Battlecruiser|ship}}</nowiki><br />
Code: '''<nowiki>{{Class|Halcyon|light cruiser|ship}}</nowiki>'''
Result: {{ShipClass|CCS|Battlecruiser|ship}}
 
Result: {{Class|Halcyon|light cruiser|ship}}
 
If we want to leave out the follow-on text altogether, we make the third  parameter empty.


If we want to leave out the follow-on text altogether, we make the third  parameter an empty space. Note that the third parameter's space is not included in the output.
Code: '''<nowiki>{{Class|Halcyon|light cruiser|}}</nowiki> and the text that comes after.'''


Code: <nowiki>{{ShipClass|CCS|Battlecruiser|ship}}</nowiki> and the text that comes after.<br />
Result: {{Class|Halcyon|light cruiser|}} and the text that comes after.
Result: {{ShipClass|CCS|Battlecruiser| }} and the text that comes after.<br />


[[Category: Templates]]
[[Category:Templates]]</noinclude>
</noinclude>