Template talk:Gallery

From WikiProjectMed
Jump to navigation Jump to search
WikiProject iconPhotography Template‑class
WikiProject iconThis template is within the scope of WikiProject Photography, a collaborative effort to improve the coverage of photography on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.

Many parameters aren't documented here

Several of these parameters appear to be compatible with this template: why aren't they included in the template's documentation? Jarble (talk) 15:32, 27 July 2023 (UTC)[reply]

Please give an example, or you can edit the documentation yourself if you're feeling bold. – Jonesey95 (talk) 15:57, 27 July 2023 (UTC)[reply]
@Jonesey95: The perrow parameter seems to be compatible with this template, but the documentation doesn't mention it. Jarble (talk) 16:02, 27 July 2023 (UTC)[reply]
Thanks. I have added it to the documentation, and I took the opportunity to tidy the module and the testcases page a bit to remove unsupported parameters. I believe that the documentation lists all supported parameters now. – Jonesey95 (talk) 16:37, 27 July 2023 (UTC)[reply]
@Jonesey95: Is there an option to add a footer below the gallery or a frame around the gallery, as in {{Multiple image}}? Jarble (talk) 16:43, 2 August 2023 (UTC)[reply]
I think that we are limited to the options listed at Help:Gallery tag. I don't know for sure, though. – Jonesey95 (talk) 12:41, 7 August 2023 (UTC)[reply]
@Jonesey95: Alternatively, it's possible to put the {{gallery}} template inside an {{image frame}} with a caption below it. Jarble (talk) 20:03, 12 September 2023 (UTC)[reply]

Question on default width / height

Hello,

Module:Gallery contains the following lines:

gargs['widths'] = tonumber(args.width) or 180
gargs['heights'] = tonumber(args.height) or 180

That sure makes it sound like the default width / height for traditional galleries is supposed to be 180x180. However, this is not actually true. Either gargs isn't being used at all, or else some other bit of parsing later on down the line throws it out, because the default gallery size end up being 120x120 if no width / height arguments are passed in. Is this a bug, or a feature? Where is the step that actually changes an unset widths / heights to 120?

(Context: I'm considering starting an RFC to change the default to something larger, but would like to know the technical constraints first. Maybe there's some deep issue with doing that or other problem to be aware of.) SnowFire (talk) 03:33, 9 September 2023 (UTC)[reply]

To partially answer my own question: https://www.mediawiki.org/wiki/Manual:$wgGalleryOptions suggests that 120 is the default value at a MediaWiki-wide setting (confirmed at https://github.com/wikimedia/mediawiki/blob/master/includes/SetupDynamicConfig.php#L115-L123 ). So what is this gallery args default doing, anyway? If it was supposed to be setting widths & heights to 180 if unset, it's clearly not doing its job. Is this just a bug if 180x180 was always intended for English Wikipedia? (Note that I'm asking here because Module talk:Gallery redirects here...) If this functionality is bugged, that implies we need to go set the wgGalleryOptions at a lower config level rather than merely modify the Module code. SnowFire (talk) 18:06, 13 September 2023 (UTC)[reply]
Before you start an RFC, you might consider requesting that a module editor modify the sandbox of this module, or other modules or code on which it depends, in a way that provides for a larger default image. As you appear to have deduced, starting an RFC could be a waste of time if it turns out that changing the default size is not possible. – Jonesey95 (talk) 19:41, 13 September 2023 (UTC)[reply]
Are we sure that you are talking about {{gallery}}? Here is a comparison between <gallery>...</gallery> and {{gallery}}, both in minimal form:
Using <gallery>...</gallery>, these images render at 120×89 and 95×120:
<gallery> Stephen Taber and the Rockland Breakwater.jpg|''Stephen Taber'' and the Rockland Breakwater Schooner Stephen Taber, around 1900.jpg | ''Stephen Taber'' anchored off Long Island c. 1900 </gallery>
Using {{gallery}}, these images render at 182×135 and 144×182:
{{gallery |File:Stephen Taber and the Rockland Breakwater.jpg|''Stephen Taber'' and the Rockland Breakwater |File:Schooner Stephen Taber, around 1900.jpg | ''Stephen Taber'' anchored off Long Island c. 1900 }}
Trappist the monk (talk) 21:44, 13 September 2023 (UTC)[reply]
@Trappist the monk: I'm talking about <gallery>, not the template version. I'm asking here because, as noted above, Module talk:Gallery redirects to this Template talk page, so I presume this is intended to be the one place for gallery talk. The fact that the gallery tag has a different default than the template is... not good and surprising in a bad way, I don't think editors expect that. (Also as a slight nitpick, it's 180 not 182.) If this was unintentional, than it sounds like the Module is bugged if it's supposed to be using the same 180 as default.
@Jonesey95: How exactly would I force an edited sandbox version to be used, though? Apologies if it's a dumb question, but I haven't ever attempted to force a Sandbox module to be used rather than the default SnowFire (talk) 03:02, 14 September 2023 (UTC)[reply]
OK, now I'm confused. What is your goal? – Jonesey95 (talk) 13:25, 14 September 2023 (UTC)[reply]
The extra 2px is the 1px boarder applied by the module with the bordered-images css class (Module:Gallery/styles.css line 76).
At Module:Gallery line 112 is this:
frame:extensionTag{ name = 'gallery', content = '\n' .. table.concat(gallery,'\n'), args = gargs}
For my example gallery, that line creates a <gallery>...</gallery> tag that looks like this:
<gallery class="nochecker bordered-images whitebg" heights="180" widths="180">
File:Stephen Taber and the Rockland Breakwater.jpg|Stephen Taber and the Rockland Breakwater
File:Schooner Stephen Taber, around 1900.jpg|Stephen Taber anchored off Long Island c. 1900</gallery>
Module:Gallery is overriding the 120px <gallery>...</gallery> tag default. If you want to change the <gallery>...</gallery> tag default, this template/module is not the place to do it. Perhaps en.wiki has a configuration switch that can be changed increase <gallery>...</gallery> tag default height/width. You might ask at WP:VPT.
Trappist the monk (talk) 14:38, 14 September 2023 (UTC)[reply]
Jonesey95: I'm trying to see what would be required to change the default behavior of the gallery tag, not the template.
Trappist: So you're basically saying that the Module doesn't control the Gallery tag behavior at all, just this template? I see. Thanks for the information. (And yes, I know about the borders, but you said "these images render at 182×135" which sounded like you meant, well, the image itself.) SnowFire (talk) 18:59, 14 September 2023 (UTC)[reply]
It sounds like you want to post at Help talk:Gallery tag. When you visit there, you may come across a link to this discussion, where, unfortunately, two changes were proposed at the same time, and one of them was opposed strongly, so the size increase did not happen. – Jonesey95 (talk) 20:55, 14 September 2023 (UTC)[reply]
I'm afraid I came here from Help talk:Gallery tag, as you can see I already opened a section there awhile back ("Galleries, part 2"). I was under the impression that the Module code was where the tech-ier side lived hence asking here, but seems like that's not the case. And yes, I'm familiar with the earlier RFC, I'm referring to potentially running a second RFC strictly on size and not on packed vs. traditional, as noted on the linked talk page. I guess I'll keep looking to find where the config file used lives. SnowFire (talk) 15:51, 15 September 2023 (UTC)[reply]
Perhaps this setting: mw:Manual:$wgGalleryOptions
Trappist the monk (talk) 18:30, 16 September 2023 (UTC)[reply]
I'm familiar - it's linked in my second comment above. Hence why I said the real question is who to talk to change this and where the current config file for English Wikipedia is stored. SnowFire (talk) 00:02, 17 September 2023 (UTC)[reply]
Module:Gallery is the underlying code of Template:Gallery, and this is the talk page for both. Their code is not used by <gallery>...</gallery>, which is an extension to the MediaWiki software. Changes to the latter are discussed at Help talk:Gallery tag. --Redrose64 🌹 (talk) 21:47, 17 September 2023 (UTC)[reply]

Adjusting margins between images

See the discussion here: is it possible to remove the empty spaces between images in a gallery tag in "packed" mode? Jarble (talk) 16:07, 21 September 2023 (UTC)[reply]

Can I Use the Pie Chart Template inside of this Template?

I am trying to make 2 pie charts be right next to eachother, they are the same size. Can i use Template:Pie chart inside of the gallery template? 😎😎PaulGamerBoy360😎😎 (talk) 15:54, 14 December 2023 (UTC)[reply]

I don't think so. You might have luck with {{Image frame}}. – Jonesey95 (talk) 19:31, 14 December 2023 (UTC)[reply]