Template:Class

From Sins of the Prophets Wiki
Revision as of 02:38, 10 February 2024 by BaconShelf (talk | contribs) (Created page with "<includeonly>{{#ifeq:{{{3|}}} |{{{3|u}}} |{{#if:{{{3|}}} |[[{{{1}}}-class {{{2}}}|''{{{1}}}''-class {{{3}}}]] |[[{{{1}}}-class {{{2}}}|''{{{1}}}''-class]] }} |[[{{{1}}}-class {{{2}}}|''{{{1}}}''-class {{{2}}}]] }}</includeonly><noinclude> ==Purpose== To avoid having to enter the following code to achieve the proper link and italics: Code: '''<nowiki>{{Class|Halcyon|light cruiser}}</nowiki>''' Result: {{Class|Halcyon|light cruiser}} ==Usage== Most cases we w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.