Template talk:Stack/Archive 1

Latest comment: 7 years ago by Frietjes in topic Mobile
Archive 1

A very good template

I'm surpirsed this idea hasn't been used before. This is a great template that will solve image spacing which has become a major problem. We should publicise this throughout wikipedia. Aflakim is a genius for thinking of this one. Tobyk777 03:02, 30 August 2006 (UTC)

Hey thanks, although I have a funny feeling something like this already exists. Somewhere. I just couldn't find it. --Alfakim-- talk 19:32, 30 August 2006 (UTC)

Broken layout in Opera 9.0

(Note: This issue is cross-posted on Wikipedia:Village pump (technical), where there is some discussion. —Lowellian (reply) 01:56, 3 August 2009 (UTC))

This Template:Stack template claims to be an easier-to-use version of Template:FixBunching. However, unlike Template:FixBunching, in Opera 9.0, the current version of this Template:Stack shoves the entire article way down the page, leaving lots of whitespace. See the photo manipulation article for an example. Clearly it must be possible to fix this, since Template:FixBunching doesn't have this problem. Can someone please fix this? Thanks. —Lowellian (reply) 21:29, 31 July 2009 (UTC)

Is this still broken? I added some alternative syntax to make it more similar to the FixBunching template. In particular, if you pass each stacked element as a separate parameter, it will insert rows between the elements, (analogous to the {{FixBunching|mid}} statements). The only other difference that I can see is that FixBunching forces a line break at the end of the stack. Plastikspork ―Œ(talk) 17:11, 20 March 2010 (UTC)
I just checked, with the photo manipulation article: February 27, 2010 [1] and later revisions, which use Template:FixBunching, render correctly in Opera 9.0. But February 13, 2010 [2] and earlier revisions, which use Template:Stack, still render badly in Opera 9.0, with the text shoved all the way down below the last image. Thanks for your efforts, Plastikspork, but sadly, the problem is still there. Could that line break you mention have something to do with it? —Lowellian (reply) 20:33, 20 March 2010 (UTC)

Purpose

Can someone explain how this differs from {{Fix bunching}} that was since removed as obsolete in July? --Joy [shallot] (talk) 17:06, 12 October 2011 (UTC)

Very good question. I will try to summarise the situation as I see it, but it may be a bit WP:TLDR. Back before changes to the core MediaWiki:Common.css we had a problem with the [edit] links becoming bunched up when there were too many right floating objects in a single section. The [edit] links would get pushed down to below the last right floating element in the section above. The solution was to group all the right floating elements together into a single right floating block, using {{fix bunching}}, which then unbunched the [edit] links. Then, there was a breakthrough, and changes were made to Common.css that eliminated this problem. Several editors, including myself, were elated, and we proceeded to remove this template from every article. But then, there was a problem, it was discovered that if you try to float several things to the right, then float something to the left, the left floating object is blocked from moving up past the top of the last right floating object. This meant that we still needed a way to "stack" multiple right floating elements together into a single right floating element, to allow the left floating element to keep closer to the location in the text where it was placed. This template was then created to indicate that the problem being addressed was not "bunching of edit links" but a need to "stack elements together". So, in some ways, this template is doing the same thing, but for a different reason. The semantics of how it is called is also different, in that there is no longer a "fix bunching|mid", and the "fix bunching|beg" and "fix bunching|end" are split into two separate templates ("stack begin" and "stack end"), or a single "stack" call. One good thing about using separate templates is that you can do a database query to check for "begin" without "end" or "end" without "begin". I have updated the documentation to indicate what is going on. I hope this helps explain the situation. I will try to find a simple example to demonstrate what issues this template is designed address. Frietjes (talk) 17:34, 12 October 2011 (UTC)
Excellent. My next question is - should we start obsoleting {{Right-floating table}} and similar templates using these more generic ones? --Joy [shallot] (talk) 18:32, 12 October 2011 (UTC)
That sounds reasonable to me. I would say that the "right-floating table" can be replaced with this template, possibly with the "clear" option enabled if necessary. Frietjes (talk) 19:48, 12 October 2011 (UTC)
Once I actually had a look at the code, it was pretty clear. IMHO it's annoying to have names like "wrapper", "stack" or "floatbox" because they obfuscate the fact that it's all just a HTML table. --Joy [shallot] (talk) 15:51, 16 October 2011 (UTC)
I prefer to separate the purpose from the method, since the method can change (e.g., the table may be changed to a div). We don't call {{infobox}} a "right-floating table" even though that's how it is implemented. However, I do agree that we have too many of these, and should start merging them. In particular "floatbox" may be a better name for "stack", but there is no visible "box" around the float. Thanks. Plastikspork ―Œ(talk) 19:03, 16 October 2011 (UTC)
redirects are fine, but we should try to reduce the number of templates that do (basically) the exact same thing. thanks to whoever helped with reducing the usage of {{wrapper}}. Frietjes (talk) 15:24, 17 October 2011 (UTC)

Stacking near an infobox

See here for a thread about a possible problem/solution for stacking images next to an infobox. Plastikspork ―Œ(talk) 22:44, 19 March 2010 (UTC)

Archived at Wikipedia:Village pump (technical)/Archive 72#Stacking images. An easy fix is to put {{clearright}} above the stack, which forbids anything (including infoboxes) from floating to the right of it. Hairy Dude (talk) 22:08, 16 September 2010 (UTC)
{{stack}} failed to preserve spacing at Paneer (see this revision). Adding a div with appropriate float and clear styles worked, but in that case this template seems to have no effect! Hairy Dude (talk) 19:12, 12 October 2012 (UTC)
if you are going to add clear right, there is no reason to even have the stack template. I removed it. Frietjes (talk) 20:56, 12 October 2012 (UTC)

Stacking left

Even using the parameter "left," my stacks appear on the right. I've tried both horizontal and vertical, but nothing works. Anyone know what I'm doing wrong? Thanks a lot! Vzeebjtf (talk) 14:14, 22 December 2012 (UTC)

I took a look at Wallack's Theatre, but could not figure out exactly where you were trying to stack something to the left. I adjusted the margins for the left floating elements, and provided an example of how to use {{multiple image}}, which is usually preferable to stack for related images. Frietjes (talk) 17:00, 22 December 2012 (UTC)
{{stack}} doesn't recognise |left| as a parameter; it's a parameter value. Two parameters permit this value: |float=left and |clear=left. --Redrose64 (talk) 21:16, 22 December 2012 (UTC)
Thanks to both of you for your prompt replies and for clearing up the mystery. And Frietjes, thanks for the demo on multiple images. And for the demo on margins as well; I was wondering why there weren't any -- now I know! :) Vzeebjtf (talk) 06:57, 24 December 2012 (UTC)

Better markup

It might be a good idea to tag the resulting markup with a class, "mw-stack" or something similar. This way it's easier for third party clients to differentiate between regular tables. Though I wonder if there's a need for a table tag in first place anyway. A regular div element might be more appropriate. Sophiestication (talk) 18:46, 10 May 2013 (UTC)

the problem with using a div is that it I have seen it cause overlap problems, where tables seem to be more robust in this regard. your idea of adding a class is certainly a safer solution. Frietjes (talk) 19:56, 10 May 2013 (UTC)

Problem with VE

When editing with VE, this template seems to take up over half the page. Try editing RepRap Project for example. 58.168.155.22 (talk) — Preceding undated comment added 10:15, 23 February 2014 (UTC)

The images shouldn't all be in the lead section. With the exception of one image that is general for the whole article, they should be placed in appropriate sections, but not too many of them. See MOS:IMAGES. Once thy have been suitably distributed, the {{stack}} may be removed. --Redrose64 (talk) 20:22, 23 February 2014 (UTC)

Mobile

This causes some weirdness on mobile. At Spanish Civil War the first line of the lead section appears above the infobox, with the rest below. This makes the lead section quite hard to read. Hairy Dude (talk) 23:54, 29 July 2016 (UTC)

Hairy Dude, I tried viewing that page in a revision near 29 July, and I didn't see any problem. however, there was no need for this template in that article, so I removed it. Frietjes (talk) 16:11, 27 August 2016 (UTC)
Here's another example: Blackletter#Origins. The images (except the first, oddly) float to the right, leaving a very narrow and difficult-to-read column of text to the left. Hairy Dude (talk) 12:19, 10 September 2016 (UTC)
Hairy Dude, it looks like the standard WP:Sandwiching problem, which is related to all floating content. for example, I changed the example you provided to use multiple image and we have basically the same problem. when I look at the example at WP:Sandwiching in mobile, it has the same problem, and that uses standard images without this template. the standard fix for sandwiching is to stagger the left and right floating content. Frietjes (talk) 16:59, 9 October 2016 (UTC)