Template:Sclass/core/testcases
This is the template test cases page for the sandbox of Template:Sclass/core. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
- Sclass/core/sandbox (edit · t · history · diff · links · /test · Source · e · t · hist · links · /subpages · /doc · /doc edit)
- hyphened
- {{Sclass}} (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test)
- {{Sclass2}} (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test)
Categories
[edit]Sclass
[edit]Basic (1, 2)
[edit]- Error: {{sclass}} missing required parameter: class name (help)
- {{Sclass|One|Two|3|Four|Five}}
- One-class Two
- One-class Two -- hardcoded
- One-class Two (Five) Two (Four) -- targets
- Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help)
Errors
[edit]Benjamin Franklin-class submarine
1, 2 missing | Error: {{sclass}} missing required parameter: ship type (help) | Error: {{sclass/sandbox}} missing required parameter: ship type (help) |
Error: {{sclass}} missing required parameter: class name (help) | Error: {{sclass/sandbox}} missing required parameter: class name (help) | |
3 is unk, 6 | Error: {{sclass}} invalid format code: 6. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 6. Should be 0–5, or blank (help) |
Error: {{sclass}} invalid format code: 99. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 99. Should be 0–5, or blank (help) | |
Error: {{sclass}} invalid format code: xyz. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: xyz. Should be 0–5, or blank (help) | |
{{Sclass}}: nonhyphen is R target: Benjamin Franklin class submarine |
Benjamin Franklin-class submarine | Benjamin Franklin-class submarine |
show DABs, target: King George V-class battleship (1939) | Error: {{sclass}} invalid format code: 9. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help) |
Format (3)
[edit]An optional third parameter allows you to control the format and use the template if Ship type is not an article:
The values and results for format are:
- 0: suppresses ship type display entirely. Adjectival form
- 1: displays ship type as part of the single link to the class article
- 2: displays ship type, but unlinked
- 3: displays ship type as a separate link. Ship type must be the name of an article
- 4: suppresses ship type display entirely. Noun form.
- 5: class name only, suitable for tables
- 6: Deprecated Use Option 1
To avoid the dreaded red link, one of the first three options must be used if Ship type is not already an article. Note that option 3 is the default, so may be omitted. Other values of format will let you know the error of your ways.
- {{Sclass| Haskell | attack transport |x}}
- Target article:
Haskell-class attack transport
Param | Wikicode | Result | /sandbox | note |
---|---|---|---|---|
None | [[Haskell-class attack transport|''Haskell''-class]] [[attack transport]] | Haskell-class attack transport | Haskell-class attack transport | Default |
0 | [[Haskell-class attack transport|''Haskell''-class]] | Haskell-class | Haskell-class | Adjectival form |
1 | [[Haskell-class attack transport|''Haskell''-class attack transport]] | Haskell-class attack transport | Haskell-class attack transport | Article title |
2 | [[Haskell-class attack transport|''Haskell''-class]] attack transport | Haskell-class attack transport | Haskell-class attack transport | When the ship type article does not exist |
3 | [[Haskell-class attack transport|''Haskell''-class]] [[attack transport]] | Haskell-class attack transport | Haskell-class attack transport | Same as default |
4 | [[Haskell-class attack transport|''Haskell'' class]] | Haskell class | Haskell class | Noun form |
5 | [[Haskell-class attack transport|''Haskell'']] | Haskell | Haskell | Table or chart form |
6 | [[Haskell-class attack transport|''Haskell'' class attack transport]] | Error: {{sclass}} invalid format code: 6. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 6. Should be 0–5, or blank (help) | Deprecated Use option 1 |
9 | [[Haskell-class attack transport|''Haskell'' class attack transport]] | Error: {{sclass}} invalid format code: 9. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help) | (show target) |
DAB (4, 5)
[edit]- DAB-4=1967
- target: Redoutable-class submarine (dab-4 unused)
- opt9: Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help)
- {{Sclass|Redoutable|submarine|x|1967}}
- Target article:
Redoutable-class submarine (1967)
- DAB article:
Redoutable-class submarine
- Bangor-class minesweeper
- Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help)
Param | Wikicode | Result | /sandbox | note |
---|---|---|---|---|
None | [[Redoutable-class submarine|''Redoutable''-class]] [[submarine]] | Redoutable-class submarine | Redoutable-class submarine | Default |
0 | [[Redoutable-class submarine|''Redoutable''-class]] | Redoutable-class | Redoutable-class | Adjectival form |
1 | [[Redoutable-class submarine|''Redoutable''-class submarine]] | Redoutable-class submarine | Redoutable-class submarine | Article title |
2 | [[Redoutable-class submarine|''Redoutable''-class]] submarine | Redoutable-class submarine | Redoutable-class submarine | When the ship type article does not exist |
3 | [[Redoutable-class submarine|''Redoutable''-class]] [[submarine]] | Redoutable-class submarine | Redoutable-class submarine | Same as default |
4 | [[Redoutable-class submarine|''Redoutable'' class]] | Redoutable class | Redoutable class | Noun form |
5 | [[Redoutable-class submarine|''Redoutable'']] | Redoutable | Redoutable | Table or chart form |
6 | [[Redoutable-class submarine|''Redoutable'' class submarine]] | Error: {{sclass}} invalid format code: 6. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 6. Should be 0–5, or blank (help) | Deprecated Use option 1 |
9 | [[Redoutable-class submarine|''Redoutable'' class submarine]] | Error: {{sclass}} invalid format code: 9. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help) | (show target) |
5
[edit]- DAB-5=1939
- target: King George V-class battleship (1939)
- opt9: Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help)
- {{Sclass|King George V|battleship|x||1939}}
- Target article:
King George V-class battleship (1939)
- DAB article:
King George V-class battleship
Param | Wikicode | Result | /sandbox | note |
---|---|---|---|---|
None | [[King George V-class battleship|''King George V''-class]] [[battleship]] | King George V-class battleship | King George V-class battleship | Default |
0 | [[King George V-class battleship|''King George V''-class]] | King George V-class | King George V-class | Adjectival form |
1 | [[King George V-class battleship|''King George V''-class battleship]] | King George V-class battleship | King George V-class battleship | Article title |
2 | [[King George V-class battleship|''King George V''-class]] battleship | King George V-class battleship | King George V-class battleship | When the ship type article does not exist |
3 | [[King George V-class battleship|''King George V''-class]] [[battleship]] | King George V-class battleship | King George V-class battleship | Same as default |
4 | [[King George V-class battleship|''King George V'' class]] | King George V class | King George V class | Noun form |
5 | [[King George V-class battleship|''King George V'']] | King George V | King George V | Table or chart form |
6 | [[King George V-class battleship|''King George V'' class battleship]] | Error: {{sclass}} invalid format code: 6. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 6. Should be 0–5, or blank (help) | Deprecated Use option 1 |
9 | [[King George V-class battleship|''King George V'' class battleship]] | Error: {{sclass}} invalid format code: 9. Should be 0–5, or blank (help) | Error: {{sclass/sandbox}} invalid format code: 9. Should be 0–5, or blank (help) | (show target) |
Sclass2
[edit]Basic2 (1, 2)
[edit]- Error: {{sclass2}} missing required parameter: class name (help)
Errors2
[edit]Tribal-class destroyer Flower corvette Flower-class corvette
1, 2 missing | Error: {{sclass2}} missing required parameter: ship type (help) | Error: {{sclass2/sandbox}} missing required parameter: ship type (help) |
Error: {{sclass2}} missing required parameter: class name (help) | Error: {{sclass2/sandbox}} missing required parameter: class name (help) | |
3 is unk2, 6 | Error: {{sclass2}} invalid format code: 6. Should be 0–5, or blank (help) | Error: {{sclass2/sandbox}} invalid format code: 6. Should be 0–5, or blank (help) |
Error: {{sclass2}} invalid format code: 99. Should be 0–5, or blank (help) | Error: {{sclass2/sandbox}} invalid format code: 99. Should be 0–5, or blank (help) | |
Error: {{sclass2}} invalid format code: xyz. Should be 0–5, or blank (help) | Error: {{sclass2/sandbox}} invalid format code: xyz. Should be 0–5, or blank (help) | |
{{Sclass2}}: nonhyphen is R target: Flower class corvette |
Flower-class corvette | Flower-class corvette |
show DABs, target: King George V-class battleship (1939) | Error: {{sclass2}} invalid format code: 9. Should be 0–5, or blank (help) | Error: {{sclass2/sandbox}} invalid format code: 9. Should be 0–5, or blank (help) |
Format2 (3)
[edit]An optional third parameter allows you to control the format and use the template if Ship type is not an article:
The values and results for format are:
- 0: suppresses ship type display entirely. Adjectival form
- 1: displays ship type as part of the single link to the class article
- 2: displays ship type, but unlinked
- 3: displays ship type as a separate link. Ship type must be the name of an article
- 4: suppresses ship type display entirely. Noun form.
- 5: class name only, suitable for tables
- 6: Deprecated Use Option 1
To avoid the dreaded red link, one of the first three options must be used if Ship type is not already an article. Note that option 3 is the default, so may be omitted. Other values of format will let you know the error of your ways.
- Target article: Flower-class corvette
- {{Sclass2|Flower|corvette|x}}
Param | Wikicode | Result | /sandbox | note |
---|---|---|---|---|
None | [[Flower-class corvette|Flower-class]] [[corvette]] | Flower-class corvette | Flower-class corvette | Default |
0 | [[Flower-class corvette|Flower-class]] | Flower-class | Flower-class | Adjectival form |
1 | [[Flower-class corvette|Flower-class corvette]] | Flower-class corvette | Flower-class corvette | Article title |
2 | [[Flower-class corvette|Flower-class]] corvette | Flower-class corvette | Flower-class corvette | When the ship type article does not exist |
3 | [[Flower-class corvette|Flower-class]] [[corvette]] | Flower-class corvette | Flower-class corvette | Same as default |
4 | [[Flower-class corvette|Flower class]] | Flower class | Flower class | Noun form |
5 | [[Flower-class corvette|Flower]] | Flower | Flower | Table or chart form |
6 | [[Flower-class corvette|Flower class corvette]] | Error: {{sclass2}} invalid format code: 6. Should be 0–5, or blank (help) | Error: {{sclass2/sandbox}} invalid format code: 6. Should be 0–5, or blank (help) | Deprecated Use Option 1 |
DAB2 (4, 5)
[edit]- {{sclass2|Tribal|destroyer|1||1905}}
- Tribal-class destroyer
- Error: {{sclass2}} invalid format code: 9. Should be 0–5, or blank (help)
- Error: {{sclass2/sandbox}} invalid format code: 9. Should be 0–5, or blank (help)