Jump to content

Help talk:Gallery tag

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Wikipedia talk:Gallery tag)

Improvement?

[edit]

hi, traditional is a nice display:

  • could an option being added to have hover & overlay option with it ?
  • when a link= is set is there an option to open it in new windows ?

thanks for the good work ! ^_^

Frogg - 2015/04/24 11:29 Gmt+1 — Preceding unsigned comment added by 81.57.18.192 (talk) 09:30, 24 April 2015

Adjusting margins between images

[edit]

Unlike {{Multiple images}}, galleries in "packed" mode leave empty spaces between the images. Is it possible to display these images in a gallery tag without spaces between them? Jarble (talk) 16:04, 21 September 2023 (UTC)[reply]

Apparently not – there's a minimum width of 60px in the code, here: [1]. I would suggest making the gallery taller to meet this minimum width. Matma Rex talk 20:36, 26 October 2023 (UTC)[reply]

Centred caption?

[edit]

In the first example under Extended syntax, the set of images is aligned left with the caption above. However, the caption is centred within the page, not centred within the set of images. The same for a packed gallery: the gallery can be aligned left via style="text-align:left", but the caption remains centred within the page. I could enclose the gallery in a one-cell table which does constrain the caption, but that hurts. Is there any clean way to adjust the caption to be over the centre of the gallery? — GhostInTheMachine talk to me 14:23, 26 May 2024 (UTC)[reply]

Dark mode problems

[edit]

I've run into a problem where in dark mode, some images display correctly (e.g. real-life photographs) but some do not (e.g. line drawings with transparent backgrounds). An example of this can be seen at Overlapping circles grid#Gallery. Normally the solution would be to add "class=skin-invert-image" to the images that need it, but it appears the gallery tag does not support this? It needs to be applied to some images but not others, so it can't just be added for the whole gallery. I also couldn't find a template wrapper that supports this, perhaps because it's not supported in the underlying Lua module? -- Beland (talk) 21:35, 4 August 2024 (UTC)[reply]

I added that class to the gallery, and it works fine in dark mode for me, but the class applies to every image, which does not seem appropriate. There should be a way to apply that class to an individual image. – Jonesey95 (talk) 21:55, 4 August 2024 (UTC)[reply]
Yes, exactly. -- Beland (talk) 22:42, 4 August 2024 (UTC)[reply]
If it's any help, the WMF staff know about this problem already and say that they are working on it. In the meantime, the fix is to apply a non-transparent background to the image itself. – Jonesey95 (talk) 13:28, 5 August 2024 (UTC)[reply]
Excellent. -- Beland (talk) 18:03, 5 August 2024 (UTC)[reply]
The phabricator bug is T370074. It looks like they are working on a generalized solution for all SVG images that have transparent backgrounds. – Jonesey95 (talk) 14:58, 6 August 2024 (UTC)[reply]
The problem specific to galleries has moved to phab:T372255. -- Beland (talk) 07:13, 25 September 2024 (UTC)[reply]

multi-line captions?

[edit]

Please explain (in the article) if the gallery tag can have multi-line captions, and if so, how. (Not talking long captions that get line-wrapped; talking captions you specify should occupy multiple lines). CapnZapp (talk) 11:31, 31 August 2024 (UTC)[reply]

If you really do need explicit lines, then add <br> HTML tags, or use {{br}}. If you need a blank line between, then {{br|2}} also works — GhostInTheMachine talk to me 11:56, 31 August 2024 (UTC)[reply]
I'm asking on behalf of the article, not myself. Anyway, I've added your info to the page, thanks. CapnZapp (talk) 14:37, 31 August 2024 (UTC)[reply]