Template talk:WPMILHIST Infobox style

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Military history (Rated Template-Class)
MILHIST This template is within the scope of the Military history WikiProject. If you would like to participate, please visit the project page, where you can join the project and see a list of open tasks. To use this banner, please see the full instructions.
Temp Templates and modules do not require a rating on the quality assessment scale.

Make navbox margin conform to other navboxes[edit]

{{editprotected}} Please change the line "|nav_box_wide= margin-bottom: 0.5em;" to just be "|nav_box_wide=" (i.e., delete the style for the wide nav box). This will make these navboxes have the same formatting as all other navboxes that use the {{Navbox}} form. With this line in place, a strange gap appears that shouldn't. --CapitalR 06:57, 18 September 2007 (UTC)

Done (although, in my opinion, navboxes look much neater when they're spaced out than they do when the borders are run into each other). Kirill 10:00, 18 September 2007 (UTC)


This is an exceedingly wide infobox. I suspect that it is this wide because you guys apparently mandate 300px for all your images. In general, it is best not to overrule user thumb size preferences. If people set their thumb size preferences to smaller sizes, you should assume they have done so for a reason, and respect that.

You can defer to user thumb size preferences without putting a frame around your image by using the "frameless" argument on images. I've just implemented that on Template:Infobox Ship. [1]

That template now respects user thumb size preferences, but unfortunately it remains 315px wide even when the image is small, because of the unusually large width of this template. That means users with small thumb size preferences get presented with a small image drowning in a sea of whitespace, in an overly wide infobox. This can be fixed by reducing the width of this template to something much smaller, such as 195px. If you do so, the template will still expand in width to accommodate users with larger thumb sizes.

Hesperian 12:46, 14 January 2008 (UTC)

That's part of it, but not the entire issue. The infobox(es) using this style are meant to stack; see, for example, any article using campaignboxes (e.g. Ulm Campaign). The fixed width is necessary to ensure that this works properly; a narrower box would be stretched by a wider image, but this wouldn't stretch the other boxes below it as well, breaking the stacking effect. Kirill 13:19, 14 January 2008 (UTC)
Note that, in any case, WP:MOS considers a fixed width to be appropriate for "a lead image that captures the essence of the article (recommended not to be smaller than 300px, as this will make the image smaller for users who have set 300px in their user preferences)". So the overall point—allowing thumbnail preferences to work on the lead image—isn't necessarily one that enjoys consensus anyways. Kirill 13:27, 14 January 2008 (UTC)
Well, I don't agree with what the MOS says there - I see no reason for a lead image to defy thumb settings merely because it is the lead image. But your stacking argument is impossible to argue with. That's a shame, because I really think these infoboxes look bizarrely wide. Hesperian 13:38, 14 January 2008 (UTC)
P.S. [2] Hesperian 13:39, 14 January 2008 (UTC)
Fair enough. Personally, I'm not sure whether the image size really matters—I think that an image significantly narrower than its enclosing box can be used to good effect in some cases—but that's more of a personal preference, I suppose. Kirill 13:48, 14 January 2008 (UTC)

Yup, forcing 315 px for the whole infobox is terribly much - see how frex Albert Blithe looks now; please decrease it, and preferably use relative units like 20em. --Malyctenar (talk) 09:42, 21 February 2008 (UTC)

Edit request transferred from Infobox Military Conflict[edit]

{{editprotected}} Hi. This is an edit request originally filed on the Infobox Military Conflict talkpage, so references to "the template" etc were made with that infobox in mind:


  • Reduce the template's default line-height to 1.25em so the gaps between wrapped lines don't make wrapped lines look like new entries in lists of combatants, commanders, casualties, etc; and also so that the gaps between wrapped lines are smaller than those between lines and the top/bottom edges of the boxes they're in.
  • Boost {{{conflict}}}'s font-size to 115% so it appears more title-like, i.e. larger than the text in the body of the template.

Sardanaphalus (talk) 17:14, 8 August 2008 (UTC)

The first one shouldn't be a problem, I think; but the second one doesn't really make sense to me. That line isn't intended to be a title; it's just another field that happens to be displayed with a colored background for aesthetic reasons (hence why it's also not bolded). Kirill (prof) 16:47, 9 August 2008 (UTC)
  • Thanks for your response. {{{conflict}}} appears bolded here and is at the top of the Military Conflict infobox, so it sure looks to me as if it's trying to be a title/header..? Sardanaphalus (talk) 19:14, 9 August 2008 (UTC)
  • There's certainly no bolding on that line in the base template; it's just regular text with a blue background. Is there somewhere in specific where it's appearing bolded? Kirill (prof) 22:25, 10 August 2008 (UTC)

Reducing the line height seems to have had an adverse effect on box readability... HMS Victory (1620) for example now appears rather crushed together and hard to follow compared to how it was before. There is no delineation between fields anymore. Martocticvs (talk) 21:40, 10 August 2008 (UTC)

Yes, it does seem a bit cramped. Part of that might be the ship infobox itself—some of the others don't seem to show it as much—but I'm not sure whether this is really an improvement over the old version. Kirill (prof) 22:25, 10 August 2008 (UTC)
Some pages seem to be showing it while others aren't, and it's affecting more than just ship infoboxes, compare Battle of Trafalgar with Battle of Waterloo. I agree with Martocticvs that the previous, more clearly spaced version is preferable. Benea (talk) 23:56, 10 August 2008 (UTC)
Can this change be reverted and, perhaps, further tested before any future implementation? The spacing of Ship infoboxes is too tight right now. — Bellhalla (talk) 13:53, 11 August 2008 (UTC)
I think it only shows up on a page once the page's cache has been purged... so hitting edit shows you what it really looks like. Martocticvs (talk) 16:36, 11 August 2008 (UTC)
It does look a little cramped, however, I've long thought the spacing between the various fields is too wide. Perhaps something in between would be best? An additional problem with the recent change however is that the spacing doesn't appear to be regular either, it actually gets wider toward the end of the infobox, which is weird. Gatoclass (talk) 16:40, 11 August 2008 (UTC)
Halfway might be ok - I think the main thing is that the spacing between fields needs to be more than exists between lines in other elements - unordered lists, for example. With it the same, everything is mashed in together making it much harder to follow. It possibly was a little on the airy side before, so a halfway or thereabouts compromise might be an ideal solution. Martocticvs (talk) 18:50, 11 August 2008 (UTC)
Reverted for now. It looks like this is going to need some experimentation before implementation, so I've disabled the editprotected tag (Kirill can handle any edits required anyway, I'm sure). Happymelon 20:54, 12 August 2008 (UTC)

Adding a class[edit]

Is it possible to add a class, to {{Infobox military unit}}, which uses this template, such that it will apply to the whole of the former template? The class is needed for a microformat, not for styling. Thank you. Andy Mabbett | Talk to Andy Mabbett 20:31, 26 August 2008 (UTC)

Invalid CSS[edit]


Could someone please change three instances of;

  • background: lightsteelblue;


  • background-color: #B0C4DE;

and one instance of;

  • background: gainsboro;


  • background-color: #DCDCDC;

The '-color' is the correct property name and the named colors are invalid; numeric values are almost always required.

Cheers, Jack Merridew 15:28, 4 April 2009 (UTC)

I don't really see the need to make these changes, especially renaming the colors to their hex values. Both lightsteelblue and gainsboro are supported by every browser I'm aware of, and named colors are used widely across Wikipedia. Also, I can think of a few thousand other templates that use "background" instead of "background-color", and there's no real harm done in it. --CapitalR (talk) 21:24, 4 April 2009 (UTC)
Well, there's probably little point, but given that they don't hurt anything, I've gone ahead and changed them. This template is almost never edited, so there's no real impact from using the (less readable) hex values. Kirill [pf] 01:04, 5 April 2009 (UTC)


{{edit protected}} Please change:

{{Wikipedia:WikiProject Military history/Infobox style}}
[[Category:WikiProject Military history templates| ]]



so that the documentation for this template is transcluded via a proper /doc subpage. PC78 (talk) 17:25, 18 October 2010 (UTC)

Done. Kirill [talk] [prof] 05:37, 19 October 2010 (UTC)

Edit request on 12 September 2016[edit]

Please reduce the minimum width for the infoboxes. 315px is unnecessarily wide. It adds additional white space, and takes up too much of the screen, particularly on a tablet in portrait since it takes up over half the screen. According to MOS:IMGSIZE, images in the introduction should be no wider than 300px, "for comfortable display on the smallest devices 'in common use'". 270px (17em) is standard, which I think would be more appropriate. This width is a nice balance as it leaves a reasonable amount of space so that most rows in the infobox do not wrap, provided editors are following infobox guidelines concerning the use concise information. Wide infoboxes also encourage editors to add too much information to the infobox.

In Module:WPMILHIST Infobox style, change:

retval.main_box_raw = 'width:315px;' .. retval.main_box_raw_auto_width


retval.main_box_raw = 'width:270px;' .. retval.main_box_raw_auto_width


Rob984 (talk) 13:45, 12 September 2016 (UTC)

Question: How about simply removing the width declaration? It should then default to the basic infobox width, which is currently 22em, computing to 271px in Vector skin (and maybe all skins, I haven't checked). This could also simplify future maintenance; if the basic infobox gets a modernization pass (it's been a fixed width layout table since 2004 and it's starting to show), this infobox's width would match any changes. Matt Fitzpatrick (talk) 23:53, 12 September 2016 (UTC)
I've made a mockup of what an infobox might look like going from 315px (left) to 22em (right). Matt Fitzpatrick (talk) 00:27, 13 September 2016 (UTC)
The fixed width setting is intended to allow infoboxes that use this set of styles to stack with "campaignbox"-type templates; see, for example, the arrangement on Battle of the Somme. If the fixed width were to be removed altogether, this would no longer be possible, as there would be no way for the auxiliary templates to determine the width at which the primary infobox was being displayed.
It's worth noting, incidentally, that many (if not most) instances of these infoboxes do use a 300-pixel, fixed-width image, so removing the setting will not actually shrink them to a 22em width unless the image widths are individually reset on each article. Kirill Lokshin (talk) 01:45, 13 September 2016 (UTC)
@WP:MILHIST coordinators: The change proposed here would apply to all military-related infoboxes, but I believe {{infobox military operation}} and {{infobox military unit}} might be the only ones that rely on the fixed width setting to align campaignboxes? Are there any other use cases we've seen in practice. Kirill Lokshin (talk) 01:48, 13 September 2016 (UTC)
I think those are the only two, although we also cover equipment, vehicles, ships, and other such areas so if we are to consider all possibilities its possible there is a cluster I haven't though of. I am concerned about the proposed reduction in width vis-a-vis the ability to add actually legible information in the infobox, while it may be true that other infoboxes are small most other infoboxes are not by their nature required to carry a minimum of two separate rows for information overview. This particular infobox carries the belligerents, areas, casualties, etc for both sides of a given conflict (like World War II), and shrinking it could cause information to become too smooshed to be of use to anyone - particularly in cases where the infobox has to adopt to handle belligerents from a third party forces, such as can be seen at War in Afghanistan (2015–present). At a minimum I feel that we need more input here before moving forward with or rejecting this idea to compensate for unusual and unique issues of this nature. TomStar81 (Talk) 07:47, 13 September 2016 (UTC)
I find even 300px small on the 36" desktop monitor. Even on the 13" tablet, they are none too large. I would like them larger, but 300px is the max. Hawkeye7 (talk) 09:37, 13 September 2016 (UTC)
Is it not possible to simply remove the width declaration, and have Template:Infobox military conflict and similar determine their own minimum width? Where I noticed the unusually large infoboxes was in instances of Template:Infobox national military. Most of these don't have a 300px fixed-width image, and have no need for the large minimum width. Do the various military-related infoboxes need to have the same minimum width?
The instance you link to, War in Afghanistan (2015–present), is actually wider than 315px, so reducing the minimum width would have no affect. A 36" monitor, and 13" tablet are neither small devices when you consider a large portion of readers are using 10" devices and smaller. On a 10" Nexus 10, an infobox like the one at War in Afghanistan (2015–present) spans about half the page in portrait. An 8" iPad Mini is similar. Once you get as small as 7", infoboxes are placed above the introduction. At 5", the infobox is being squished to fit on the screen. At 4.5", it is causing a horizontal scroll because it's width cannot be reduced any more (you can preview these screen sizes using developer tools in Chrome and Firefox). If an infobox has to be greater than 270px to fit the necessary information, then so be it. But we shouldn't have every infobox at 315px as a minimum.
Also, would it be possible for campaignboxes have their width set to 100% instead of having a fixed width? Template:Infobox military unit is also one I would particularly like to see a little smaller.
Rob984 (talk) 13:30, 13 September 2016 (UTC)
Toggling for now. I've pinged Wikipedia talk:WikiProject Military history about the suggested change which currently looks like it hasn't reached consensus. Re-open if this call was not correct though — Andy W. (talk ·ctb) 15:56, 13 September 2016 (UTC)
WP:SHIPS notified.
Trappist the monk (talk) 16:43, 13 September 2016 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── Please leave it alone.Keith-264 (talk) 16:17, 13 September 2016 (UTC)

I'm not sure what the correct solution is here, but fixed pixel widths are almost always going to be wrong. As noted above, 300px is too wide on a tablet, too narrow on a big desktop. Widths in typographic units (em) is a bit better as people tend to size their windows so that a readable amount of text, usually 45-90 em, fits across them. I'm fond of prescribing widths in multiples of the user's prefered image width, like the "upright" image param. But I don't think that's available to the infobox module. Also I've been told I'm a snob for assuming users will know or care about the image width preference. Kendall-K1 (talk) 17:07, 13 September 2016 (UTC)
Ah but a snob with style and grace. ;o)) In my case, the minutiae of the debate about making the article compatible with a plethora of screen sizes, is a matter beyond my knowledge or interest but I like the 300px width on my laptop and would like to keep it. Regards Keith-264 (talk) 14:06, 15 September 2016 (UTC)
Currently it is 315px. I think this is unnecessarily large even on laptops and larger devices, especially since images shouldn't be that large in the lead (as i mentioned earlier, 300px is the maximum recommend for the lead). I only propose we reduce the minimum size presently set for all infoboxes. Infoboxes which need to be wider, in particular those with more than 2 columns, can be made wider with individual minimum widths. Have a look at Eurofighter Typhoon for example. Most of the additional space is empty, and the image is larger than it needs to be. If that infobox was only 270px, it would look just as good on a laptop or larger, but a lot better on a tablet. Rob984 (talk) 22:14, 15 September 2016 (UTC)
The current infobox width looks good on my 13" laptop. I also favour leaving things as they are: it's important to remember that the military history infoboxes, and especially those for battles, contain lots of information and reducing the width would cause a whole lot of new problems around the length of infoboxes. The infoboxes also work fine with the Wikipedia phone and tablet apps. Nick-D (talk) 10:45, 16 September 2016 (UTC)
There's a compromise between length and width. If the vast majority of lines wouldn't wrap at 270px, yet the infobox is 315px, then the additional width will be far greater than the additional length caused by one or two lines wrapping. In cases where most lines would wrap, then the 315px width should be retained. One size doesn't fit all. Would it not be more appropriate to specify a minimum width for each template, rather than forcing 315px for all military infoboxes?
In the phone and tablet apps, the width of all infoboxes is fixed to the equivalent of 270px. So if the content of an infobox is optimised for 315px, then forcing it into a 270px infobox on a phone or tablet might look cramped, wrap excessively, and thus increase the length. Not sure that "works fine"? But that's a content, not template issue. I think its a reasonable trade-off in some cases (even if it leads to these issues on small screens), particularly those on conflicts which contain information about participants. The only problem I am trying to resolve here is that cases where the infobox does not need to be 315px wide (like Eurofighter Typhoon), but is nonetheless forced to be, which causes issues for mobile and tablet web readers. If an infobox has a lot of content and so must be 315px, then that is a reasonable trade-off. But in cases where it doesn't, and the information fits fine at 270px, why are we causing issues for mobile and tablet web readers? The additional white space might look nice to some on desktops, but if it causes readability issues on tablets then I think we should remove it. This is why the guidelines on images sizes exist (300px maximum).
Rob984 (talk) 19:07, 16 September 2016 (UTC)