Help talk:Gallery tag

From Wikipedia, the free encyclopedia
  (Redirected from Wikipedia talk:Gallery tag)
Jump to: navigation, search
Wikipedia Help Project (Rated NA-class, Mid-importance)
WikiProject icon This page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
 NA  This page does not require a rating on the project's quality scale.
 Mid  This page has been rated as Mid-importance on the project's importance scale.

Caption from Image Description?[edit]

Is there a way to have the caption use the Image's description automatically?

External images on gallery[edit]

Hi everyone!
I'm trying to insert external images into gallery, but it don't want to work...
I've enabled the External images on the settings file.
If I'm writing: It will work. But if I'm writing: <gallery>< </gallery>
It won't work...

What can I do?


Change to alt text info[edit]

The gallery tag has supported alt text for over a year. Kaldari (talk) 21:08, 6 June 2012 (UTC)

I just came here to check that because I thought that it did not, but I see it being used in examples. Blue Rasberry (talk) 21:01, 11 September 2012 (UTC)

Requested move[edit]

The following discussion is an archived discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review. No further edits should be made to this section.

The result of the move request was: page moved. Armbrust The Homunculus 09:20, 25 January 2013 (UTC)

Wikipedia:Gallery tagHelp:Gallery tag – This page explains details of a technical feature of the MediaWiki software. The policy aspects are covered at Wikipedia:Image use policy#Image galleries (linked via a hatnote). Though there is much overlap and confusion between the Wikipedia: and Help: namespaces, the general practice is to have technical documentation in the Help: space. See for example Help:Wiki markup, Help:Category, Help:Searching, Help:Link. the wub "?!" 13:37, 13 January 2013 (UTC)

  • Support, good idea. I noted a while ago that there are indeed still many help pages in the project space, gotta start moving them someday. --The Evil IP address (talk) 21:18, 13 January 2013 (UTC)
The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page or in a move review. No further edits should be made to this section.

Pixel border on image?[edit]

Is there a way to add a pixel border to a gallery image? This would help with some images that have the same color as the background, such as flags in some cases. Illegitimate Barrister (talk) 01:57, 7 February 2013 (UTC)

You could use {{gallery}}, which has borders built in. --Redrose64 (talk) 12:25, 7 February 2013 (UTC)

Display text link instead of image in gallery[edit]

It would be nice to add a colon in front of the file name and disply a text link to the image instead of the image.

Markup would be like so...

:File:Bearded Collie.jpg
File:St Bernard Dog.jpg

Result would be something like this...

Bulldog.jpg File:Bearded Collie.jpg St Bernard Dog.jpg

Reason for this is to have the ability to easily place non-free images into the gallery here. And I suppose it might be useful in other areas as well. Using the colon is intuitive here, because it's already the way to turn an image into an image link. We'd simply be extending that syntax to galleries. – JBarta (talk) 05:33, 19 June 2013 (UTC)

The <gallery> tag is part of the MediaWiki software; there's not much we can do from this end to alter its behaviour. You'd need to put a feature request through bugzilla:. --Redrose64 (talk) 08:20, 19 June 2013 (UTC)
Done. – JBarta (talk) 13:34, 19 June 2013 (UTC)

MediaWiki 1.22/wmf13[edit]

MediaWiki 1.22/wmf13 will add a mode parameter.[1] --  Gadget850 talk 05:40, 17 August 2013 (UTC)

Examples --  Gadget850 talk 08:01, 17 August 2013 (UTC)

Wiki-syntax in caption parameter[edit]

This: <gallery mode=packed caption="Components of the Earth's magnetic field at the surface from the [[World Magnetic Model]] for 2010.<ref name="renamed_from_2010_on_20131022170733">{{Cite report |authors=Maus, S., S. Macmillan, S. McLean, B. Hamilton, A. Thomson, M. Nair, and C. Rollins |year=2010 |title=The US/UK World Magnetic Model for 2010-2015 |url= |publisher=National Geophysical Data Center |accessdate=18 October 2013}}</ref>" align=center heights=155px> File:WMM2010 F MERC.pdf|Intensity File:World Magnetic Inclination 2010.pdf|Inclination File:World Magnetic Declination 2010.pdf|Declination </gallery>

Renders as:

We appear to have lost the caption as it has a ref in it. Is this a known problem? Jamesx12345 20:11, 29 October 2013 (UTC)

It's badly formed, that's for sure. Eliminating much of the text and irrelevant attributes, what you have here is
<gallery caption="caption text.<ref>ref text</ref>">
The < and > characters, which are used to begin and end the tags, must alternate - you can't begin a fresh tag - such as <ref> - until any incomplete tag - such as <gallery> - has been properly ended. --Redrose64 (talk) 20:48, 29 October 2013 (UTC)

You can do this with #tag:gallery:

Markup Renders as|-
File:WMM2010 F MERC.pdf{{!}}Intensity
File:World Magnetic Inclination 2010.pdf{{!}}Inclination
File:World Magnetic Declination 2010.pdf{{!}}Declination
|caption="Components of the Earth's magnetic field at the surface from the [[World Magnetic Model]] for 2010.<ref name="renamed_from_2010_on_20131022170733">{{Cite report |authors=Maus, S., S. Macmillan, S. McLean, B. Hamilton, A. Thomson, M. Nair, and C. Rollins |year=2010 |title=The US/UK World Magnetic Model for 2010-2015 |url= |publisher=National Geophysical Data Center |accessdate=18 October 2013}}</ref>"


  1. ^ Maus, S., S. Macmillan, S. McLean, B. Hamilton, A. Thomson, M. Nair, and C. Rollins (2010). The US/UK World Magnetic Model for 2010-2015 (PDF) (Report). National Geophysical Data Center. Retrieved 18 October 2013. 

Note that the parameters must come after the content and must be delimited by a pipe. The pipes for the image captions must be escaped using {{!}}. --  Gadget850 talk 22:33, 29 October 2013 (UTC)

Spacing glitch?[edit]

Recently, I've noticed that galleries that auto-format into two rows have a big gap in the first row, see forex Rhodochrosite#Gallery. This may be a Firefox artifact -- displays fine in Safari. MacOS user.  ??? --Pete Tillman (talk) 22:12, 1 February 2014 (UTC)

Looks OK in Firefox 26 under Windows XP. --Redrose64 (talk) 22:59, 1 February 2014 (UTC)


I have a chandelier in my possession that we bought from an antique dealer in 1962, listed on it is the name ROCHESTER. We were told at the time, that it came from the Battle Cruiser ROCHESTER when it was refitted, in 1927 or so.If you have a picture of chandelier's that were on the ship, it might help. This is solid Brass and quite nice looking. The wife wants to get rid of it now. We were wondering if it was seeked after. Would it be a good museum piece. The ship hauled many Marines into battle, and might interest them. if this is off the ROCHESTER. IT would be nice to know. Daniel Donnelly — Preceding unsigned comment added by (talk) 19:20, 6 February 2014 (UTC)

This isn't a good page for questions like this one. I suggest you visit the Humanities reference desk and ask there. Some of the volunteers there may be able to help you. -- John of Reading (talk) 20:03, 6 February 2014 (UTC)

Location of Gallary in Article[edit]

Could someone write in this help Article where to place the Gallery? Is it before or after External links, e.g. Timelezz (talk) 14:00, 3 March 2014 (UTC)

I don't think that there is a rule, as such; but after "External links" is certainly too far down. Sections like "External links" are covered at MOS:APPENDIX, and there is no mention of galleries there; but elsewhere in the same document there is WP:LAYIM which has a link to WP:IG which in turn links to WP:MOSIMAGES. None of those prescribe a specific location for a gallery, but all of them indicate that interspersing the images throughout the text is preferable to a gallery. --Redrose64 (talk) 14:28, 3 March 2014 (UTC)

Problem with heights?[edit]

I've just added some galleries to the article Flag of Tuvalu and the heights parameter seems to be ignored (see revision 619557986). Without the widths parameter, the flags are all smaller but the heights are still ignored (see revision 619557913). Does anyone know this functionality well enough to fix my problem (or the bug itself), please? Thanks! — OwenBlacker (Talk) 15:08, 2 August 2014 (UTC)
Edited to add: This applies to the nolines format, not traditional. — OwenBlacker (Talk) 18:15, 2 August 2014 (UTC)

@OwenBlacker: Er, Flag of Tuvalu hasn't been edited in five months... do you mean Flag of Vanuatu? --Redrose64 (talk) 18:09, 2 August 2014 (UTC)
@Redrose64: Yes I do, thank you. Though it's no longer apparent in the current version, as I turned off nolines, to compensate for the inability to add borders to images. Sorry, I'm an idiot!  :o) — OwenBlacker (Talk) 18:15, 2 August 2014 (UTC)

Align captions for mode=packed?[edit]

Hello, is it possible to align the captions for mode=packed? style="text-align:center" does not seem to work.--Sinuhe20 (talk) 20:16, 18 March 2015 (UTC)

Help:Gallery_tag#Center --  Gadget850 talk 20:33, 18 March 2015 (UTC)


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 (talk) 09:30, 24 April 2015

packed-hover on touch screen[edit]

I'm not sure what the point is having packed-hover and pack-overlay when they appear the same on a touch screen. You can't see the image properly when the caption is overlaid over the image, so completely defeating the purpose of an image gallery. Hzh (talk) 15:48, 10 August 2015 (UTC)

Size adjusting with packed[edit]

Under usage notes, it says that It is good practice not to overspecify the size, unless there is a strong reason to override the user's viewing preferences. The packed mode will automatically adjust image sizes to use available display space optimally. Packed galleries do not seem to enlarge pictures so that the gallery fills the screen width (which seems like it would be a nice feature), so I'm not sure what this note means. Are galleries broken or is this wrong? Under syntax, it states that As you can see, the narrowness of the image distorts the caption. This may easily be fixed by adding the heights= parameter, which seems to imply that the tag is working as expected and the the above note is wrong. Personally, I think that automatic resizing sounds like a nice features, but either the note or the gallery tag should be clarified or fixed. —Ost (talk) 19:21, 17 September 2015 (UTC)

The gallery autosizing feature seems to have developed a bug a few months ago, and I'm not sure where to report/complain about this problem. Overspecifying the size to override viewer preferences would add another problem which won't go away even after the bug is resolved. Previously, the autosize feature worked very well, and I expect that it can be restored to proper function by a qualified coder. Reify-tech (talk) 22:22, 17 September 2015 (UTC)

is there a way to add an image border in the gallery?[edit]

I can't figure out a way to add a border to gallery images like with normal images. See flag gallery here - Pan-Slavic colors and note the flags that are bordered by white do not look correct. Thanks! МандичкаYO 😜 00:19, 20 December 2015 (UTC)

Alt text[edit]

I've never seen the alt-text function in the gallery tag before. Today I read about it here, but I can't get it to work. I don't see the alt text in the example. I'm using Chrome, and my friend using two different Mac browsers can't see it either.

-abbedabbtalk 14:44, 26 January 2016 (UTC)

Ping: Paracel63. -abbedabbtalk 14:47, 26 January 2016 (UTC)
Seems OK to me. If you view the page source, you should be able to locate the <img /> element for the image itself - it's the one with the attribute src="//" In the same tag, you will find the attribute alt="This is Conchita Wurst", so it's definitely there. Alt text on an img element is used in two main circumstances: (i) by screen reader software; (ii) if the image cannot be displayed or is still loading (in recent Firefox versions). If you see the image, there's no need for your browser to do anything with alt text. --Redrose64 (talk) 15:36, 26 January 2016 (UTC)
@Redrose64: I'm not quite following you. "Alt" text is used to present additional information (not suitable for inclusion in a caption) about an image, upon hovering above the image. This works in thumb-formatted images through the "alt=" parameter, and it's available through a specific parameter in many infoboxes. Why this behaviour should not be available also for gallery images is beyond me. Or am I missing something? Best of wishes.--Paracel63 (talk) 09:12, 28 January 2016 (UTC)
This is not entirely true. Tooltips are generated by the browser, normally from the title= attribute of the element that you are hovering over; if your browser displays it from the alt= attribute, it is non-standard behaviour. The purpose of alt text is described at WP:ALT, which uses the word "tooltip" twice, "above" once (out of context), and doesn't mention either "hover" or "over" at all. --Redrose64 (talk) 10:43, 28 January 2016 (UTC)
Thanks for the info. I've talked about the issue with other wikipedians during the day, and now I understand the "alt" tag more. Best of wishes.--Paracel63 (talk) 13:24, 28 January 2016 (UTC)
Now I get it! I understand now that the hover texts I've seen on Wikipedia are actually the "title"-perameter in the link tag, and not the alt-tag. Yay! I've learned something today! -abbedabbtalk 13:22, 28 January 2016 (UTC)

Image too narrow on "Water cribs in Chicago"[edit]

There's a gallery at the bottom of Water cribs in Chicago. There's one image which is very narrow and the gallery hover effect makes it unclickable. What's the best way to work around this? Lordgilman (talk) 17:13, 6 May 2016 (UTC)

Lordgilman, this doesn't answer your question, but I moved all the gallery images from the Water cribs in Chicago article to a new gallery page on Wikimedia Commons. -Mindfrieze (talk) 15:26, 28 June 2016 (UTC)

Slideshow widths[edit]

Hi. You said it does not work. It does not work properly, but good enough to use it. IKhitron (talk) 16:16, 24 July 2016 (UTC)


Not sure, if this issue has been adressed before ... Is it possible to make the transparent parts of a file (more specifically logos) appear transparent inside the gallery-tag. Right now, a white background is show around logos, which seems misplaced due to the gray background in between the white background of the logo and the border. Froztbyte (talk) 20:00, 13 January 2017 (UTC)

Harvesting an entire category of images onto Gallery[edit]

For our Wikiproject gallery , I am looking for a way to populate the gallery automatically with images categorised under our Wikiproject. Any help possible? Basically, we have the slideshow already. Is it possible for the slideshow to automatically get images? prashanthns (talk) 11:49, 28 January 2017 (UTC)

@Prashanthns: The page that you linked, Commons:WikiProject Nature and conservation in India, does not exist. --Redrose64 🌹 (talk) 21:34, 28 January 2017 (UTC)
I believe they meant Commons:Commons:WikiProject Nature and conservation in India, Redrose64 IKhitron (talk) 22:45, 28 January 2017 (UTC)
Indeed. Thanks for the correct link IKhitron. Also corrected link in my original message now. prashanthns (talk) 04:22, 29 January 2017 (UTC)

Difficulty in creating a galery from a semantic request or from images "harvested" in a form[edit]

Hello !

It would be useful for me to be able to "build up" a gallery with images selected through a semantic request, or from a form. Trying to use the <hovergallery>, it did not work.

The type of syntax I'd like to use is like this (Image1 being a data in a form):

<hovergallery maxhoverwidth=600 maxhoverheight=600>
{{#ifeq: {{{Image1|}}} | | | {{{Image1}}} }}

It seems that the gallery instructions are "read" by the system before the File:xxx.jpg syntax is caught. The HoverGallery creator tells me that his extension calls the <gallery> tag internally, and that this limitation could be related to te <gallery> tag itself. Do anyone know if that's the case ? Is there a known way to override that ? Or is it a real limitation ?

Thanks, anyway ! -- T Daunois (talk) 10:12, 29 June 2017 (UTC)

Did you try to create a template using #tag? Maybe it will help, I didn't check. IKhitron (talk) 10:58, 29 June 2017 (UTC)
@IKhitron: - No, I didn't, I haven't had the opportunity (yet) to work with galleries, so I'm discovering. But I'll try and let you know if it's working in this field. Thanks, IKhitron. -- T Daunois (talk) 12:05, 29 June 2017 (UTC)
It seems it's working well. Do I get the point in considering that the #tag is a way to "escape" some limitations of the <> tags ? -- T Daunois (talk) 12:13, 29 June 2017 (UTC)
Glad it helps. Indeed. It is used to create a "dynamic" tag in a template. IKhitron (talk) 12:33, 29 June 2017 (UTC)
@T Daunois: Please note that the HoverGallery extension is not installed on English Wikipedia, so the <hovergallery>...</hovergallery> tags will not be recognised. --Redrose64 🌹 (talk) 13:01, 29 June 2017 (UTC)
@Redrose64: Sure, I'm working on a semantic wikis' network using MediaWiki and SMW :-) -- T Daunois (talk) 10:24, 2 July 2017 (UTC)

Gallery displays differently on Commons versus En WP[edit]

This is an odd case but it led to something unusual with the gallery tag.

I uploaded a picture on Commons. The picture includes about 30 other pictures, each of which needs the copyright checked. To demonstrate that all the images are free, I put all of them in a gallery in the file description. On Commons it displays nicely.

In English Wikipedia the gallery is not created. The text should be the same, because the English file description is a copy of what Commons has.

Can anyone advise on what I could do differently to have it display neatly across Wikimedia projects? Is this perhaps a bug to be reported? Thanks. Blue Rasberry (talk) 00:43, 22 November 2017 (UTC)

Unfortunately, they can't. See phab:T118728. IKhitron (talk) 18:22, 22 November 2017 (UTC)