Module talk:Random slideshow

WikiProject iconPortals  
WikiProject iconThis page is within the scope of WikiProject Portals, a collaborative effort to improve portals 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.
Template This module does not require a rating on the project's quality scale.
Note icon
See also: List of Portals

Portraits and panoramas

Hi, would it be possible to add a height parameter in addition to width, so that you can limit the size of portrait-format images? And, ideally, would it be also possible to add a functionality similar to Wide image to better display panoramic pictures? — Kpalion(talk) 16:00, 19 July 2018 (UTC)Reply

Ideally some way of limiting the image size to fit into the screen. · · · Peter (Southwood) (talk): 17:26, 28 July 2018 (UTC)Reply

Non-free images being included in slideshows

Is there a way to tweak this templates syntax so that it doesn't call up any non-free images when it's used on pages like Portal:Anti-nuclear movement? Non-free files are only allowed to be used in the article namespace per WP:NFCC#9 which means they shouldn't be displayed on portal pages. -- Marchjuly (talk) 04:15, 23 August 2018 (UTC)Reply

@Marchjuly: This should already be done... Module:Excerpt is used to parse page content, which tests images and excludes those which are non-free. Which specific image or images are slipping through? - Evad37 [talk] 04:50, 23 August 2018 (UTC)Reply
File:Nuclear hand.png is getting flagged as being used on "Portal:Anti-nuclear movement". -- Marchjuly (talk) 04:55, 23 August 2018 (UTC)Reply
So its a non-free file within a gallery, which probably shouldn't be there in the first case per Wikipedia:Non-free_content#Multimedia. But in any case, I'm modifying the code to also check gallery files (which are processed separately to other files) for non-free content. - Evad37 [talk] 05:12, 23 August 2018 (UTC)Reply
  Done - Evad37 [talk] 05:17, 23 August 2018 (UTC)Reply
Thanks Evad37. -- Marchjuly (talk) 05:25, 23 August 2018 (UTC)Reply
@Evad37: Would you mind taking a look at Portal:Tron. The same thing that happened above seems to be happening in that portal regarding File:Tron2lightcycle.jpg and File:Tron Lightcycles.jpg. -- Marchjuly (talk) 05:36, 27 August 2018 (UTC)Reply
@Marchjuly:   Fixed. They were specified on the portal itself, so just needs to be removed there [1] - Evad37 [talk] 05:55, 27 August 2018 (UTC)Reply
Thank you. -- Marchjuly (talk) 06:10, 27 August 2018 (UTC)Reply

HTML code appearing in the captions of some images

Several images use templates in their captions, such as for keys in maps (see Territories of the United States) and it would be a good idea to either:

  • Remove the result of the templates (so remove HTML code from captions)
  • Allow the template to show its content/results (so allow parsing of HTML code in the image captions)

See Portal:United States Territories for an example of this happening, but I have seen it in other portals. Dreamy Jazz 🎷 talk to me | my contributions 17:07, 11 September 2018 (UTC)Reply

  Fixed, just needed to make sure linebreaks were removed from expanded templates - Evad37 [talk] 02:29, 12 September 2018 (UTC)Reply

Image dimensions displayed as captions

As used at Portal:Greek alphabet, the code

{{Transclude files as random slideshow
| Greek alphabet
|
|
}}

produces captions like x12px for many of the images. To me, these are image dimensions, not intended to be shown to the non-editing reader. --Redrose64 🌹 (talk) 23:16, 27 February 2019 (UTC)Reply

@Redrose64:   Fixed. The module was previously sometimes confusing the size for the caption; now it will either display the real caption, or leave off the caption if there isn't one. - Evad37 [talk] 00:24, 28 February 2019 (UTC)Reply
  Thank you --Redrose64 🌹 (talk) 10:54, 28 February 2019 (UTC)Reply

Nifty use of this template for a sidebar slideshow, maybe we should support this correctly?

I used the "Transclude files as random slideshow" template to create a sidebar slideshow. You can see the effect on the right hand side here. While the markup is pretty minimal, there are several semi-hacks I had to do to get it to work:

  1. I wrapped the "Transclude files as random slideshow" template in the "sidebar" template
  2. The edge spacing on the gallery is too much for fitting in the side bar, so to zoom it in I used negative margins with inline-block display
  3. You can't size the gallery according to a thumbnail, so to get the sizing right I include a hidden image in the sidebar and then size the gallery to that
  4. The trouble then is that if you click another image in the page and then use the right / left directional arrows to go through all images, you'll see the hidden image. To work around THAT, I stuffed in a fallback image in the hidden ___location.
  5. Tweaked the border color to match thumbnail pics

The images only appear on desktop for some reason; on mobile all images are hidden, even though the template documentation says that 4 images should be shown on mobile. Also, during page load the images are laid out in a stacked column before collapsing, but I think that's just how the template works (it's not unique to the sidebar use).

It's a pretty nifty way to elevate some content in an article to the intro. Thoughts on supporting this as a real thing, like maybe a new template or having a setting on this template so people could discover this usage? Efbrazil (talk) 20:49, 9 May 2020 (UTC)Reply