• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Random slideshow

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]
This template contains coding that is not compatible with mobile versions of Wikipedia, causing display and accessibility problems. Read the documentation for an explanation.
This template uses Lua:
  • Module:Random slideshow (sandbox)

This template creates a slideshow gallery with a randomised order – i.e. it changes when the page is purged. It is intended for use in portals and will not display in article space.

Usage

As many images and captions as desired may be specified, in the following format:

{{Random slideshow 
| First image  | first caption
| second image | second caption
| third image  | third caption
}}

Credits (e.g. "Photograph: Example") may be specified, using the following format

{{Random slideshow 
| First image  | first caption | credit1=
| second image | second caption | credit2=
| third image  | third caption | credit3=
}}

Parameters

|1=, |3=, |5=, ... (or equivalent positional parameters)
File name. The "File:" prefix is optional.
|2=, |4=, |6=, ... (or equivalent positional parameters)
Caption for the file.
|credit1=, |credit2=, |credit3=, ...
Credits for the file. Optional.
|width=
Maximum width for all images; default is 100% (intended for use inside portal components)
Can be specified as a % (e.g. 75%), or in ems (e.g. 30em), or in px (e.g. 200px)
If a unit is not specified, px is assumed (i.e. 350 is equivalent to 350px)
|random=
Set to no or false to turn off the randomisation.

Display in the mobile view

On mobile devices, a standard gallery is displayed instead of the slideshow. If the screen width is less than 720px, only the first four images after randomisation are visible (example screenshot). For mobile devices with larger resolutions, all images are displayed (example screenshot). For some tables, it displays all images stacked (example screenshot).

Examples

Purge this page to see these galleries in a different order

Cats

{{Box-header|title=Selected pictures}}
{{Random slideshow 
| File:Cat playing with a lizard.jpg | Cat playing with a lizard
| Felis silvestris catus lying on rice straw.jpg | Cat lying on rice straw
| Mumbai 03-2016 63 Dhobi Talao Chowk.jpg | Cats in Mumbai
| File:Felis catus-cat on snow.jpg | Cat on snow
| Tired 20-year-old cat.jpg | Tired cat
}}
{{Box-footer}}
edit 

Selected pictures

  • Image 1Cat lying on rice straw
    Image 1Cat lying on rice straw
  • Image 2Cats in Mumbai
    Image 2Cats in Mumbai
  • Image 3Tired cat
    Image 3Tired cat
  • Image 4Cat on snow
    Image 4Cat on snow
  • Image 5Cat playing with a lizard
    Image 5Cat playing with a lizard

Mice

{{Random slideshow | width=275
| File:Agouti Mice.jpg | Two mice | credit1= Photograph: Pogrebnoj-Alexandroff
| Brown mouse.jpg | Brown mouse | credit2= Photograph: [[User:Kulmalukko|Tiia Monto]]
| File:Farbmaeuse.jpg | Mice with food | credit3= Photograph: [[c:User:Whitesky~commonswiki|Whitesky]]
| File:Farbmaus.JPG | Mouse on a wheel | credit2= Photograph: [[de:User:R2Dine|R2Dine]]
| White lab mouse in hand B.jpg | A mouse in the hand is worth two in the bush | credit4= Photograph: Pogrebnoj-Alexandroff
}}
  • Image 1A mouse in the hand is worth two in the bush Photograph: Pogrebnoj-Alexandroff
    Image 1A mouse in the hand is worth two in the bush

    Photograph: Pogrebnoj-Alexandroff

  • Image 2Mice with food Photograph: Whitesky
    Image 2Mice with food

    Photograph: Whitesky

  • Image 3Two mice Photograph: Pogrebnoj-Alexandroff
    Image 3Two mice

    Photograph: Pogrebnoj-Alexandroff

  • Image 4Brown mouse Photograph: Tiia Monto
    Image 4Brown mouse

    Photograph: Tiia Monto

  • Image 5Mouse on a wheel Photograph: R2Dine
    Image 5Mouse on a wheel

    Photograph: R2Dine

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Random slideshow in articles based on its TemplateData.

TemplateData for Random slideshow

Creates a slideshow gallery with randomized order. Add as many images as desired.

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Image 11 (unnamed positional parameter)

Name of the first image, without prefix

Default
(empty)
Example
Portal puzzle.svg, 1=Portal puzzle.svg
Filerequired
Caption 12 (unnamed positional parameter)

Caption of the first image

Default
(empty)
Example
2=This is the default portal icon
Stringrequired
Credit 1credit1

Credit for the first image

Example
Photograph: [[User:Example|Example]]
Unknownoptional
Widthwidth

Maximum width of all images

Default
(none)
Example
width=80px, width=30em, width=50%
Numbersuggested
Image 23 (unnamed positional parameter

Name of the second image, without prefix

Default
(empty)
Example
Brown mouse.jpg, 3=Brown mouse.jpg
Filesuggested
Caption 24 (unnamed positional parameter)

Caption of the second image

Default
(empty)
Example
4=This is a brown mouse
Stringsuggested
Credit 2credit2

Credits for the second image

Example
Photographer: [[User:Example|Example]]
Unknownoptional
  • v
  • t
  • e
Portal templates
Visual overview of template usage
Layout and formatting
  • {{Box portal skeleton}}
  • {{Box-header}}
    • color palettes
    • plain
    • round
    • square
    • watch
  • {{Box-header colour}}[1]
  • {{Box-footer}}
  • {{Flex columns}}
  • {{Plain navboxes}}
Content transclusion
  • {{Transclude lead excerpt}}[2]
  • {{Transclude linked excerpt}}[2]
  • {{Transclude list item excerpt}}[2]
  • {{Transclude random excerpt}}[2]
  • {{Transclude selected excerpt}}[2]
  • {{Excerpt}}
  • {{Transclude DYK}}[9]
  • {{Transclude selected current events}}[3]
  • {{Transclude selected recent additions}}[4]
Content slideshows
  • {{Random slideshow}}[5]
  • {{Transclude files as random slideshow}}[5]
  • {{Transclude excerpts as random slideshow}}[6]
  • {{Transclude linked excerpts as random slideshow}}[6]
  • {{Transclude list item excerpts as random slideshow}}[6]
Content randomisation
  • {{Random portal component}}[7]
  • {{Random quotation}}
  • {{Random subpage}}
General
  • {{Portals}}
  • {{Portals browsebar}}
  • {{Portal description}}
  • {{Portal information sidebar}}
  • {{Portal navbar no header2}}
  • {{Purge link portals}}
  • {{Wikimedia for portals}}
Linking templates
  • {{Portal}}[11]
  • {{Portal bar}}[12]
  • {{Portal-inline}}[13]
  • {{Pbox}}
  • {{Related portals2}}
Talk pages / Maintenance
  • {{Portal talk}}
  • {{Portal maintenance status}}[8]
  • {{Portal suggestions}}
  • {{Portal toolbox}}
  • {{WikiProject Portals}}[8]
Images
  • {{Portal dynamic image}}
  • {{Portal image banner}}[10]
  • {{Portal pictures}}[14]
  • {{Portal POTD}}
Modules
  • 1. Module:Box-header
  • 2. Module:Excerpt/portals
  • 3. Module:Selected current events
  • 4. Module:Selected recent additions
  • 5. Module:Random slideshow
  • 6. Module:Excerpt slideshow
  • 7. Module:Random portal component
  • 8. Module:Portal maintenance status
  • 9. Module:Transclude DYK
  • 10. Module:Portal image banner
  • 11. Module:Portal
  • 12. Module:Portal bar
  • 13. Module:Portal-inline
  • 14. Module:Portal pictures
Usage
  • Wikipedia:Portal
  • Wikipedia:WikiProject Portals
For more information, see: Category:Template-Class Portal pages and Category:Wikipedia Portal templates
The above documentation is transcluded from Template:Random slideshow/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Random_slideshow&oldid=1022448884"
Last edited on 10 May 2021, at 15:40

Languages

    • العربية
    • تۆرکجه
    • বাংলা
    • Буряад
    • فارسی
    • Galego
    • 한국어
    • മലയാളം
    • Bahasa Melayu
    • Oʻzbekcha / ўзбекча
    • සිංහල
    • سنڌي
    • Slovenščina
    • کوردی
    • ไทย
    • Українська
    • اردو
    • Tiếng Việt
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 10 May 2021, at 15:40 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop