Template:Transclude files as random slideshow
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: |
This template transcludes images from specified pages, and 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 does not show anything in article space.
Usage
Note: Though there is no fixed limit to the number of pages that can be specified, or images per page, be aware that technical limitations may be encountered for very large numbers of pages or images.
Specify pages displaying images:
{{Transclude files as random slideshow
| First page
| second page
| third page
}}
If images should only be retrieved from a certain section of each page:
{{Transclude files as random slideshow
| First page | section1= section name
| second page | section2= section name
| third page | section3= section name
}}
To also include some specific files:
{{Transclude files as random slideshow
| File:SpecificFileOne.jpg | caption1= Caption for first file
| File:SpecificFileTwo.png | caption2= Caption for second file | credit2= Credits for second file (optional)
| First page
| Second page
| Third page
}}
Alternate syntax for specific files' captions and credits:
{{Transclude files as random slideshow
| File:SpecificFileOne.jpg ## Caption for first file
| File:SpecificFileTwo.png ## Caption for second file ## Credits for second file (optional)
| First page
| Second page
| Third page
}}
Parameters
|1=
,|2=
,|3=
, ... (or equivalent positional parameters)- Full page name – including namespace – of the page containing images, or of a specific image.
|section1=
,|section2=
,|section3=
, ...- Limit to files in these section of the corresponding page. Optional.
|caption1=
,|caption2=
,|caption3=
, ...- Caption for the corresponding file (or omit these parameters and use the alternate syntax shown above)
|credit1=
,|credit2=
,|credit3=
, ...- Optional: Credits for the file (or omit these parameters and use the alternate syntax shown above)
|width=
- Maximum width for all images; default is
100%
(intended for use inside portal components) - Can be specified as a
%
(e.g. 75%), or inem
s (e.g. 30em), or inpx
(e.g. 200px) - If a unit is not specified,
px
is assumed (i.e. 350 is equivalent to 350px)
Display in the mobile view
On mobile devices, a standard gallery is displayed instead of the slideshow, and only the first four images (after randomisation) are visible.
Examples
{{Box-header|title=Selected pictures}}
{{Transclude files as random slideshow
| Template:Transclude files as random slideshow/testcases/1
| Template:Transclude files as random slideshow/testcases/2
| Template:Transclude files as random slideshow/testcases/3
}}
{{Box-footer}}
Selected pictures
- Tired cat (from
- Cat on snow (from
- Cats in Mumbai (from
- Example 4 (from
- Example 3 (from
- Cat playing with a lizard (from
- Cat lying on rice straw (from
{{Box-header|title=Selected pictures}}
{{Transclude files as random slideshow
| Template:Transclude files as random slideshow/testcases/2 |section1=Mice
}}
{{Box-footer}}
Selected pictures
- Two mice (from
- Mouse on a wheel (from
- A mouse in the hand is worth two in the bush (from
- Brown mouse (from
- Mice with food (from
{{Box-header|title=Selected pictures}}
{{Transclude files as random slideshow
| Australia
}}
{{Box-footer}}
Selected pictures
-
Port Arthur penal settlement is one of eleven UNESCO World Heritage-listed Australian Convict Sites. (from Australia)Tasmania's
-
Melbourne Cricket Ground is strongly associated with the history and development of cricket and Australian rules football, Australia's two most popular spectator sports. (from Australia)The
-
bushranger and outlaw Ned Kelly in The Story of the Kelly Gang (1906), the world's first feature-length narrative film (from Australia)Actor playing the
- The
- Australia has the highest ratio of international students per capita in the world, with Melbourne ranking fifth among the 2023
-
HMAS Canberra, a Canberra class landing helicopter dock, and HMAS Arunta, an Anzac-class frigate, sailing in formation (from Australia)
-
The Big Picture, a painting by Tom Roberts, depicts the opening of the first Australian Parliament in 1901. (from Australia)
- Topographic map of Australia. Dark green represents the lowest elevation and dark brown the highest. (from
-
South Australian wines (from Australia)
- A map of Australia's states and territories (from
-
Museum of Old and New Art in Hobart, Tasmania, Sidney Nolan's Snake mural (1970) is inspired by the Aboriginal creation myth of the Rainbow Serpent, as well as desert flowers in bloom after a drought. (from Australia)Held at the
- The
-
James Cook at Botany Bay on 29 April 1770 to claim Australia's east coast for Great Britain (from Australia)Landing of
-
Sydney Opera House was completed in 1973 and declared a UNESCO World Heritage Site in 2007, making it the youngest building to have received the designation. (from Australia)The
- Australian residents by country of birth, 2021 census (from
-
Postwar migrants from Europe arriving in Australia in 1954 (from Australia)
- Arising from the
-
Fitzroy Island, one of the 600 islands within the main archipelago of the Great Barrier Reef (from Australia)
-
Bombing of Darwin, the first of over 100 Japanese air raids on Australia during World War II (from Australia)The 1942
-
Köppen climate types of Australia (from Australia)
-
St Mary's Cathedral in Sydney belongs to the Roman Catholic Church, Australia's largest religious denomination. (from Australia)Australia hosts a diversity of religions.
- Basic geological regions of Australia, by age (from
- Australian Prime Minister
Embedded in sidebar, scaled to 1.35 upright |
|
{{Sidebar
| pretitle = Embedded in sidebar, scaled to 1.35 upright
| pretitlestyle = font-weight:bold;
| width =
| style = border:1px solid #c8ccd1;
| content1style = margin:-5px -5px -2.2em -5px; display: inline-block;
| content1 = {{Transclude files as random slideshow
| Template:Transclude files as random slideshow/testcases/2 |section1=Mice
}}
| content2style = height:0px; margin:0 -0.4em; padding:0; display:inline-block; visibility:hidden;
| content2 = [[File:Cat playing with a lizard.jpg|frameless|border|upright=1.35]]
}}
See also
TemplateData
| ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Transclude files as random slideshow in articles based on its TemplateData.
TemplateData for Transclude files as random slideshow No description.
|