Template talk:Infobox ship

(Redirected from Template talk:Infobox ship/doc)
Latest comment: 9 days ago by Tupsumato in topic Classification society

Update

edit
West Virginia in San Francisco Bay, circa 1934.
West Virginia in San Francisco Bay, circa 1934.
History
Sunk7 December 1941
Raised17 May 1942
General characteristics

@Prarambh20, SWinxy, and Trappist the monk: What is the latest on this merge? It has been ongoing since April of 2022. Can anyone provide me some sort of status report? Trappist the monk what is going on with Module:Infobox ship? Would be great to know what still needs to be done. I know this is a daunting conversion. If someone can take some time to give me a comprehensive status report of where we stand and what still needs to be done, I'd beee happy to take this on... Zackmann (Talk to me/What I been doing) 20:34, 8 October 2025 (UTC)Reply

There is no latest on this merge. It is stalled. For me its stalled because there was objection to the way I implemented Module:Infobox ship. Also, stalled because I claimed that custom fields are supported (link); I don't remember how I thought to implement that but it is a must-keep-functionality for these infoboxen. Also stalled because I started on a bot task to convert existing table-based infoboxen to use an {{infobox ship}} template wrapped around Module:Infobox ship. I remember immediately encountering problems that the module didn't cleanly support; alas, I neglected to keep any notes – likely because of the initial objection to my Module:Infobox ship implementation.
Trappist the monk (talk) 19:28, 9 October 2025 (UTC)Reply
@Trappist the monk: do you have thoughts on a way forward? I know this is a big one but as I said I would like to be helpful. If you've moved on to other projects that totally fine but any input you can give or information you can convey on how to move forward would be super helpful. -- Zackmann (Talk to me/What I been doing) 20:32, 9 October 2025 (UTC)Reply
I suppose that the first thing to do is to usurp Template:Infobox ship since Editor Prarambh20 is no longer with us to maintain (or defend) that template. There are ~30 mainspace articles that use the Prarambh20 infobox. So to usurp, I suppose that we must:
  1. create the subtemplates listed in holding cell
  2. replace the Prarambh20 infoboxen in mainspace with direct #invokes of Module:Infobox ship; this will serve as a way to test the new module
  3. once all Prarambh20 infoboxen have been replaced, rewrite {{Infobox ship}} to call Module:Infobox ship
  4. replace the direct #invokes with the new version of {{Infobox ship}}
  5. template documentation because the parameter names are different and the basic structure of the infobox is slightly different
After that, I suppose it is time to work out how to code a bot to do the grunt work of replacing the bulk of the existing table-based ship infoboxen.
Or, because this seems so much like an its-not-broken-so-lets-fix-it exercise, we might just do nothing; its often best.
Trappist the monk (talk) 22:48, 11 October 2025 (UTC)Reply
I have remembered how to handle custom infobox fields. In the adjacent infobox using Module:Infobox ship, the 'Sunk' and 'Raised' fields are custom. Compare to the example infobox at Template:Infobox ship begin § Custom fields.
Trappist the monk (talk) 22:48, 11 October 2025 (UTC)Reply
@Trappist the monk: Really appreciate you taking the time to explain. I've gotten caught up in a couple other projects at the moment, but once I have some time I will read through this. Hopefully I can pick this up as my next project. Thanks again! -- Zackmann (Talk to me/What I been doing) 00:11, 12 October 2025 (UTC)Reply

Updating the usage guide

edit

Hi! I wonder if anyone could help with moving Template:Infobox ship begin/Usage guide under the current template and updating the "technical side" of it. I tried to start but realized I don't know the new template well enough to update the guide. Tupsumato (talk) 12:03, 23 December 2025 (UTC)Reply

Edit request 26 December 2025

edit

Add support for a custom header label (parameter header_label):
On line 367:

if 'yes' ~= args_t.hide_header then infobox_ship_t['header' .. i] = 'Class overview'; -- add the header i = i + 1; -- bump the enumerator end
+
if 'yes' ~= args_t.hide_header then if args_t.header_label then infobox_ship_t['header' .. i] = args_t.header_label else infobox_ship_t['header' .. i] = 'Class overview'; end -- add the header i = i + 1; -- bump the enumerator end

Thanks! Aydoh8[what have I done now?] 00:50, 26 December 2025 (UTC)Reply

Has this been tested in the sandbox and on the testcases page? If so, please provide links. If not, please do so. – Jonesey95 (talk) 01:02, 26 December 2025 (UTC)Reply
I don't think that the proposed code will work because MediaWiki's version of Lua does not support the += compound assignment operator.
Is there discussion somewhere that demonstrates a need for this change? Why does the proposed change use ‹See TfM›|header_label= instead of ‹See TfM›|header_caption=? Why will it render differently from the similar code supported by {{infobox ship/characteristics}}?
Echoing, Editor Jonesey95: Sandbox and testcases?
Trappist the monk (talk) 01:34, 26 December 2025 (UTC)Reply
I've reactivated. @Trappist the monk: header_caption does not work since this is for {{Infobox ship/class overview}}. I've also fixed the code to use the standard + operator. Will provide testcases links momentarily. Aydoh8[what have I done now?] 05:26, 26 December 2025 (UTC)Reply
See Module:Infobox ship/sandbox, Template:Infobox ship/class overview/sandbox and User:Aydoh8/Type C4 ships. Aydoh8[what have I done now?] 05:40, 26 December 2025 (UTC)Reply
Yes, I know that this change is for {{Infobox ship/class overview}}. That does not explain why we should use ‹See TfM›|header_label= instead of ‹See TfM›|header_caption= which we use in {{Infobox ship/characteristics}} and {{Infobox ship/service record}} for more-or-less the same purpose. Oughtn't we be consistent in parameter naming amongst the several subtemplates?
You have ignored my question: Is there discussion somewhere that demonstrates a need for this change?
Trappist the monk (talk) 15:37, 26 December 2025 (UTC)Reply

Underscore bug

edit

When used in talkspace, the module replaces the space in the namespace prefix with an underscore, see my preceding three edits on this talk page. The same happens in user, draft, and wikipedia namespaces, presumably in the others, too. Paradoctor (talk) 14:18, 26 December 2025 (UTC)Reply

Fixed, I think. mw.title.getCurrentTitle().nsText returns multiword namespace names with underscore separators.
Trappist the monk (talk) 15:28, 26 December 2025 (UTC)Reply
Looks good from here. Thanks for the quick fix.
Resolved
Paradoctor (talk) 15:57, 26 December 2025 (UTC)Reply

infobox_caption ignores italics

edit

Here, ‹See TfM›|infobox_caption=yes and ‹See TfM›|display_title=SV ''Rembrandt van Rijn'' results in an unitalicized caption. Same outcome if ‹See TfM›|display_title=none is combined with an external DISPLAYTITLE. Paradoctor (talk) 01:05, 4 January 2026 (UTC)Reply

Because 'SV' is not recognized by Module:WPSHIPS utilities as a valid prefix. If we are to believe these search results, there are only about 20 articles about ships with the 'SV' prefix. I have added 'SV' to the module and reverted your edit as a test.
Trappist the monk (talk) 01:45, 4 January 2026 (UTC)Reply
As usual, quick work.
Resolved
Paradoctor (talk) 02:27, 4 January 2026 (UTC)Reply

@Trappist the monk: It's still not working for me. At Icon of the Seas If I set ‹See TfM›|infobox_caption=yes I do not get an italic caption. GA-RT-22 (talk) 09:26, 30 January 2026 (UTC)Reply

‹See TfM›|infobox_caption=yes can only auto-italicize captions from the article title if the article title has a recognized ship prefix (USS, MV, etc) or a recognized disambiguator prefix: <nationality> <ship type> <name>; or a parenthetical disambiguator suffix: (BB-265). The article title for Icon of the Seas has neither of these. I've tweaked the template doc some.
Trappist the monk (talk) 14:37, 30 January 2026 (UTC)Reply
Much better, thank you. This makes me wonder why it can't do what the old documentation says: "formats the infobox caption in the same way that the article title is formatted" but I assume this is a technical restriction. GA-RT-22 (talk) 14:57, 30 January 2026 (UTC)Reply
I'm pretty sure that there was a reason but what that reason was, I no longer remember. I'll add a TODO note to the module so that sometime in the future I can look into the matter.
Trappist the monk (talk) 15:04, 30 January 2026 (UTC)Reply

Edit Suggestion: "Homeport" vs. "Home port"

edit

This subtemplate uses the compound word "homeport" instead of the phrase "home port". Looking online, I can't find any traditionally published dictionary which includes the noun "homeport", though I can find multiple entries for "homeport" the verb and "home port" the noun phrase. The description of the parameter itself uses "home port" in favor of "homeport".

This only came to my attention because the word "homeport" appears twice in the body text of this article, its usage seemingly having bled outward from the page's infobox. Encyclopedia articles probably shouldn't use compound words which don't or have yet to appear in dictionaries without having some reason to do so, and I don't see any reason to prefer "homeport" to "home port" here. Unless there's something I'm missing (which there may well be), I believe the template should be edited accordingly. Cerebrosoluble (talk) 00:30, 14 January 2026 (UTC)Reply

I don't either – except that I can hear Tevye: "Tradition!". Homeport has been the spelling in the rendered infobox since the first version of {{infobox ship career}}. I won't change the parameter name (‹See TfM›|homeport=) but I have changed the displayed label.
Trappist the monk (talk) 00:51, 14 January 2026 (UTC)Reply
Ah, the question of editing the parameter name vs. the displayed label hadn't even occurred to me. That's exactly what I was looking for, though. Thank you! Cerebrosoluble (talk) 01:07, 14 January 2026 (UTC)Reply

Refit definition

edit

What qualifies for a refit to include in this infobox? Evan.oltmanns (talk) 21:31, 16 February 2026 (UTC)Reply

To clarify, how invasive or extensive must a refit be to be considered worth adding for this parameter? Evan.oltmanns (talk) 22:05, 16 February 2026 (UTC)Reply

Default title to PAGENAMEBASE

edit

@Trappist the monk: out of curiosity before I attempt to implement it, is there a reason you chose not to have a default title above the Infobox? I've come across a number of articles (such as Götheborg (ship)) with no title on the Infobox. In my experience, standard procedure is to use a default title of {{PAGENAMEBASE}}. I just want to make sure I'm not missing something and that this wasn't intentionally omitted. Zackmann (Talk to me/What I been doing) 19:10, 2 June 2026 (UTC)Reply

You are talking about the html table caption? See these discussions:
Trappist the monk (talk) 22:13, 2 June 2026 (UTC)Reply
Ok... Trappist the monk instead of referring me to 5 threads that are all over a decade old and have dozens of posts is there a chance you could just answer the question? Why is there no default title to the Infobox as is done with nearly every other Infobox on the English wikipedia? If this is established consensus thats fine, but just saying "here are 5 discussions about this from 10-14 years ago" really is not helpful in any way. Zackmann (Talk to me/What I been doing) 22:23, 2 June 2026 (UTC)Reply
You and I are not the only editors reading this discussion. Those editors who are not familiar with the topic, or who have forgotten that we had those discussions, may find them enlightening. I gave you the response that I did to avoid putting words into other editors' mouths that they did not speak.
Trappist the monk (talk) 22:37, 2 June 2026 (UTC)Reply
Ok let's try this again, can you please tell me why there is no default title to the Infobox as is done with nearly every other Infobox on the English wikipedia? Please don't just refer me to discussions from over a decade ago. You are an intelligent editor here Trappist. Surely you can give me a simple answer to this. Zackmann (Talk to me/What I been doing) 22:55, 2 June 2026 (UTC)Reply

Classification society

edit

Any thoughts of including the current classification society in the infobox? Currently dealing with a bunch of Royal Caribbean ships that recently switched from DNV to either LR or ABS, and it would make keeping track of them easier. --Ahecht (TALK
PAGE
)
16:29, 4 June 2026 (UTC)Reply

In my opinion, classification society is not relevant enough for inclusion into the infobox. I would also question its relevance in the article body without further purpose such as explanation of an interesting class notation (for example, I have usually included it in connection to a non-generic ice class, but not just on its own). Tupsumato (talk) 08:43, 5 June 2026 (UTC)Reply