Template talk:Sclass/Archive 1

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1

Optional parameter value = 4

I modified the template so that it will accept an optional parameter value of 4. This will allow properly punctuated usage of the class when it is to be used as a noun. Grammatically, using parameter value = 0 provides an adjectival form.

For example:

The last ship of the {{sclass|Haven|hospital ship|4}} is still afloat in [[Baltimore, Maryland]].

Gives this:

The last ship of the Haven class is still afloat in Baltimore, Maryland.

I tested this at {{User:Bellhalla/Sandbox}} prior to implementing the change, so I am hopeful that it will work correctly.— Bellhalla 11:41, 6 November 2007 (UTC)

Disambiguation parameter

I have added a disambiguation parameter to {{sclass}} to help avoid generating links to disambiguation pages. This is what occurred previously when the "ship type" parameter was "minesweeper". The template linked to minesweeper, a disambiguation page, rather than minesweeper (ship).

I tested the functionality of my changes at {{sclass/sandbox}} and User:Bellhalla/Sandbox before implementing them. — Bellhalla (talk) 19:03, 24 December 2007 (UTC)

hyphen use

what if you don't like using a hyphen in the class name? GraemeLeggett (talk) 08:54, 25 December 2007 (UTC)

As of right now, you can generate the form "Name class" — with no hyphen (but also no ship type) — by using format option 4, like this
{{sclass | Shipname | Classtype | 4 }}
which would produce Shipname class. — Bellhalla (talk) 11:58, 25 December 2007 (UTC)

Edit request

{{editprotected}} Please change the first line of this template from this:

  • <includeonly>[[{{{1}}} class {{{2}}}| ''{{{1}}}''<!-- remove \n

to this:

  • <includeonly>[[{{{1}}} class {{{2}}}|''{{{1}}}''<!-- remove \n

This edit will remove one extra space character that is generated in front of the link, noticeable when this template is used right after punctuation. This should be a pretty straightforward edit, but nevertheless, I have tested this change at the testcases page. — Bellhalla (talk) 16:24, 4 June 2009 (UTC)

Done. — Kralizec! (talk) 17:42, 4 June 2009 (UTC)

Optional Type

Is there a possible way to have a code similar to this template, and having the shiptype be optional? Like, perhaps you don't have a ship type to use, or it's known (For instance, Enterprise-class) (a random named I picked, by the way) That way, you could use this template with and without a type, I've tried to figure this out, but I just...can't seem to get going in the right direction.--Terran Officer (talk) 10:11, 16 April 2010 (UTC)

French wiki

Hello,

Could you add fr:Modèle:Classe to interwiki links ? Thanks, Gonzolito Pwet 21:30, 19 January 2012 (UTC)

 Done, see here, but you didn't need to use {{editprotected}} - Template:Sclass/doc is not protected. --Redrose64 (talk) 18:44, 2 May 2012 (UTC)

Avoiding Class Disambig

Is there some parameter to distinguish between different classes of the same name? For instance there are two South Dakota-class battleships, so that link just leads to the disambig. Is there a way to write it so that it will lead to one or the other? --Grahamdubya (talk) 15:33, 17 February 2012 (UTC)

Monitor disambiguation

Using {{sclass|Abercrombie|monitor}} gives Abercrombie-class monitor ([[Abercrombie class monitor|''Abercrombie''-class]] [[monitor]]). It should instead give Abercrombie-class monitor ([[Abercrombie class monitor|''Abercrombie''-class]] [[monitor (warship)|monitor]]). Headbomb {talk / contribs / physics / books} 16:43, 2 May 2012 (UTC)

Two things: (i) my understanding is that it's only the ship's name which should be italicised, the word "class" is written upright; (ii) you don't seem to have sufficient apostrophes in your <nowiki>...</nowiki> examples. --Redrose64 (talk) 18:47, 2 May 2012 (UTC)
Yeah, I fixed that. Copy-paste error. Headbomb {talk / contribs / physics / books} 19:01, 2 May 2012 (UTC)
Oh there's a disambiguation option, I didn't see that. {{sclass|Abercrombie|monitor||warship}} gives the correct output: Abercrombie-class monitor. Headbomb {talk / contribs / physics / books} 19:05, 2 May 2012 (UTC)

Edit request on 26 August 2012

Please replace the content of this with the content of Template:Sclass/sandbox. It will remove hyphens in the ship class per Wikipedia talk:WikiProject Ships/Archive 34#Ship class hyphens.

 Ryan Vesey 13:15, 26 August 2012 (UTC)

Done --Redrose64 (talk) 12:05, 28 August 2012 (UTC)
Thank you. Ryan Vesey 13:16, 28 August 2012 (UTC)

No, that's just plain wrong - and has not been properly discussed. The hyphen is essential in distinguishing between the the noun form (Foo class) and the adjectival form (Foo-class ship). This used to be properly explained at Wikipedia:WikiProject_Ships/Guidelines#Referring_to_ship_classes - until messing around with this template make a nonsense of the explanation - and thousands of other pages. I'm going to ask for the most recent change to be reverted and ask that this is properly discussed before any further changes are made. See comments at Wikipedia talk:WikiProject Ships. 212.183.128.232 (talk) 18:40, 28 August 2012 (UTC)

The template still makes a large overgenerlization, automatically changing things like Parthian class submarine to Parthian-class submarine. In addition, the noun-form is much more likely to be used. If there is going to be an exception, the exception should be for it to become the adjectival form. Ryan Vesey 18:44, 28 August 2012 (UTC)
Ryan, read MOS:HYPHEN, and please give me a moment to finish editing - I'm having snags with edit conflicts here! Thanks. 212.183.128.232 (talk) 18:48, 28 August 2012 (UTC)
what in MOS:HYPHEN are you referring to? The part that says "hyphens are never inserted into proper-name-based compounds" perhaps? Ryan Vesey 18:51, 28 August 2012 (UTC)
Ryan, my dear chap, {{sclass}} used to correctly render Parthian class submarine to Parthian-class submarine, which is always correct. "Parthian-class" is a compound modifier of submarine - ie the noun submarine is modified by the hyphenated adjectival phrase "Parthian-class". The nounal use would be "Parthian class", NOT "Parthian class submarine". If you're not a grammarian, perhaps it's worth pausing two marching paces to read up on the difference in a suitable reference - or indeed in Wikipedia's MOS at MOS:HYPHEN. Can I also point out (at the risk of further damage to the correct use of English grammar in Wikipedia) that {{sclass2}} still correctly implements the hyphen!
On the subject of "proper-name-based compounds" (and note the beautiful hyphenation in that phrase), that prohibits solecisms such as "Ryan-Vesey errors", as the example makes clear. Yours, 212.183.128.232 (talk) 19:00, 28 August 2012 (UTC)
Hmm, well for starters, my requested template change should be reverted, at least until discussion is finished. I know little about the proper naming and was just going off of what I was told earlier; however, why is it that the title of the article should be unhyphenated? It was that comment that led me to believe it was a proper-name-based compound. Ryan Vesey 19:05, 28 August 2012 (UTC)
Ryan, good question. The discussion about hyphenating article names was defeated through a mixture of WP:JDLI and a self-defeating campaign of unilateral action. It wasn't pretty - you can read it here. I personally feel the articles should prima facie be hyphenated, but I can't see us opening that can of worms again for a long time... 212.183.128.232 (talk) 19:45, 28 August 2012 (UTC)

Please revert the last change to this template. The hyphens are there for a reason - English grammar.

212.183.128.232 (talk) 18:48, 28 August 2012 (UTC)

The change should be reverted, there needs to be a hyphen in Parthian-class submarine and others. Headbomb {talk / contribs / physics / books} 19:39, 28 August 2012 (UTC)

I've asked User:Redrose64 to revert the requested edit. 212.183.128.232 (talk) 21:40, 28 August 2012 (UTC)
Done see here. --Redrose64 (talk) 21:42, 28 August 2012 (UTC)

Edit request

This is a copy of a request that I placed at WT:SHIPS. That request has gone unanswered for more than a fortnight. So:

I have finished the {{sclass}} family of templates. The newest and last member of the family is {{sclass2-}} for use with hyphenated article titles when the ship class is named for a common attribute: {{Sclass2|Flower|corvette}} produces: Flower-class corvette.
In the relatively recent past, the {{sclass}} family of templates was nominated for deletion because the original templates {{sclass}} and {{sclass2}} and the new {{sclass-}} templates were all forks - copies of the original {{sclass}}. Because of that, I created {{sclass/core}} which does all of the formatting for the four templates. Two of the templates, {{Sclass}} and {{Sclass2}} use {{sclass/core}} while the other two do not. {{sclass}} and {{sclass2}} are protected so I can't replace them with the sandbox versions that use {{sclass/core}}.
Test cases for all of the {{sclass}} templates are at the testcases page. Are there any admins who would be willing to move {{sclass/sandbox}} to {{sclass}} and {{sclass2/sandbox}} to {{sclass2}}?

Trappist the monk (talk) 16:22, 7 March 2013 (UTC)

 Done. Is there intended to be more work in consolidating these? Chris Cunningham (user:thumperward) (talk) 11:21, 19 March 2013 (UTC)
Thanks. Given my limited experience with templates, if there is a way that they can be further consolidated, I don't know what that is. Have you got an idea for further improvements?
Trappist the monk (talk) 12:22, 19 March 2013 (UTC)
Well, if {{sclass/core}} is doing all the grunt work here, do we really need to have four templates to call it? Could we not delete those four and just use {{sclass/core}} directly on articles? Chris Cunningham (user:thumperward) (talk) 12:39, 19 March 2013 (UTC)
It was my original intent to create a single template that could somehow know "how it was called" – probably through redirects. So, {{sclass}}, {{sclass2}}, {{sclass-}}, and {{sclass2-}} would somehow all call some common template. I imagined, and hoped that template parameter {{{0}}} could be read as the name of the calling template. After all if in {{Sclass|Valiant|tugboat}} Valiant is parameter {{{1}}} and tugboat is parameter {{{2}}} doesn't it infer that sclass- is parameter {{{0}}}?
Apparently that isn't the case. I created {{sclass/core}} after it was suggested to me at WT:VPT. This is how all of the CS1 citation templates work.
Trappist the monk (talk) 15:00, 19 March 2013 (UTC)
Heh: it had never occurred to me to use the shell scripting convention of parameter 0 being the template name. That would actually be extremely helpful: maybe file a MediaWiki bug? Chris Cunningham (user:thumperward) (talk) 15:29, 19 March 2013 (UTC)

Edit request #3

This request applies to {{sclass}} and {{sclass2}}.

I recently changed {{sclass/core}} to support an unnamed fifth parameter used to disambiguate ship class names. Two other members of the {{sclass}} template family, {{sclass-}} and {{sclass2-}}, have already been upgraded to use the new version of {{sclass/core}}.

{{sclass/sandbox}} and {{sclass2/sandbox}} have been modified and configured to use the live version of {{sclass/core}}. All that is required is to copy the contents of {{sclass/sandbox}} to {{sclass}} and copy the contents of {{sclass2/sandbox}} to {{sclass2}}.

There is a common test cases page for all four of the templates.

Thank you.

Trappist the monk (talk) 14:04, 5 May 2013 (UTC)

Hyphenated article name break template

There is an issue with hyphenated ship class names that breaks the template. For example, {{sclass|Oscar|submarine}} (Oscar-class submarine) creates a link, but the correct link to the hyphenated article name, {{sclass|Oscar-|submarine}} (Oscar--class submarine, article named Oscar-class submarine) fails. — btphelps (talk to me) (what I've done) 08:17, 9 February 2014 (UTC)

For hyphenated article titles, use {{sclass-}}: Oscar-class submarine.
Trappist the monk (talk) 11:40, 9 February 2014 (UTC)

Hyphenated article / redirect problem

I'm unable to get this template to output a link without a redirect on an article that hyphenates in the name (i.e. Derfflinger-class battlecruiser). Nothing I can come up with will output a link with the hyphen, necessitating a redirect (i.e. Derfflinger class battlecruiser). Can we establish a parameter to change this without screwing up the parser? For the list I'm generating, I can't use a greenlink, I need the actual target instead of a redirect (and really don't want to have to manually type piped links with italics). bahamut0013wordsdeeds 17:25, 16 December 2010 (UTC)

Yes, please fix this problem. An example is the link in the beginning of Armament of the Iowa class battleship, Iowa class battleship. Wiki code: {{sclass|Iowa|battleship|1}}. --Mortense (talk) 20:39, 21 January 2013 (UTC)
Yeah, I'm late to the party. {{sclass-}} for italicized class names; {{sclass2-}} for non-italicized class names.
Trappist the monk (talk) 11:59, 15 March 2013 (UTC)
Still the same problem. If anyone can fix, it'd be much appreciated. Illegitimate Barrister 08:14, 4 January 2015 (UTC)
Example please?
Trappist the monk (talk) 12:24, 4 January 2015 (UTC)