Template:Class

From Sins of the Prophets Wiki
Jump to navigation Jump to search

Purpose

To avoid having to enter the following code to achieve the proper link and italics:

Code: {{Class|Halcyon|light cruiser}}

Result: {{#ifeq:

|u
|{{#if:
  |Halcyon-class {{{3}}}
  |Halcyon-class
 }}
|Halcyon-class light cruiser

}}

Usage

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

Code: {{Class|Halcyon|light cruiser}}

Result: {{#ifeq:

|u
|{{#if:
  |Halcyon-class {{{3}}}
  |Halcyon-class
 }}
|Halcyon-class light cruiser

}}

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

Code: {{Class|Halcyon|light cruiser|ship}}

Result: {{#ifeq:ship

|ship
|{{#if:ship
  |Halcyon-class ship
  |Halcyon-class
 }}
|Halcyon-class light cruiser

}}

If we want to leave out the follow-on text altogether, we make the third parameter empty.

Code: {{Class|Halcyon|light cruiser|}} and the text that comes after.

Result: {{#ifeq:

|
|{{#if:
  |Halcyon-class 
  |Halcyon-class
 }}
|Halcyon-class light cruiser

}} and the text that comes after.