Images used (examples)
| ||||||||||||||
| Manual | Examples | Images used |
Gallery syntax
[edit source]Example:
This lists pages in the namespace File, and applies the format of manually specified gallery code, using the Startall (before all) and Endall (after all) arguments of gallery syntax for the open and close tags. The Start and End arguments are applied to each result in between, in this case the file page names generated by the dpl3 statement, and puts each on a new line to complete the gallery statement. Results are limited to a count of 3.
Note: When DPL3 parser function syntax is used to create a gallery, the < and > characters must be replaced by « and » respectively (to escape them).
- Code
{{#dpl:
|namespace = File
|format = «gallery mode="packed" widths="80px" heights="80px"»,%PAGE%\n,,«/gallery»
|count = 3
}}
- Result
Result:
The same result can be achieved with parser extension syntax, as seen below.
Example:
<dpl> namespace = File count = 3 format = <gallery mode="packed" widths="80px" heights="80px">,%PAGE%\n,,</gallery> </dpl>
Images contained in article
[edit source]Example:
This displays images contained (displayed, using imagecontainer) within the Apple page. Setting escapelinks=false causes direct image display (at full-size), rather than a file page link. Setting mode=none removes the default (bulleted list) formatting, displaying the image plain. Note that using format may give greater output control (see Images used (examples)).
- Code
{{#dpl:
|imagecontainer = Apple
|escapelinks = false
|mode = none
}}
- Result
Result:
Example:
This lists images used in the Apple article and uses the format parameter to format the resulting file link as a rendered image
{{#dpl:
|imagecontainer = Apple
|format = ,[[File:%TITLE%|40px]]
}}
List images used (existing or not)
[edit source]Example:
Lists all images used in the Orange articles. openreferences=true lists non-existing images, including those not housed locally, such as images used from Wikimedia Commons. Non-existing images are displayed as red links.
{{#dpl:
|imagecontainer = Orange
|openreferences=true
}}
Result:
- File:Double arrow left.png
- File:Orange, orange peel.jpg
- File:Wanted Image (please do not upload or remove).png
Display images used
[edit source]Example:
Lists all images used in the Apple and Orange articles. openreferences=true lists non-existing images, including those not housed locally, such as images used from Wikimedia Commons. Using escapelinks=false would display the image at full size, except formatting the output using format= allows control over the result, including display size.
{{#dpl:
|imagecontainer = Orange
|openreferences=true
|escapelinks=false
|format=,[[%PAGE%,{{!}}50px]],
}}
Result:
![]()
File:Wanted Image (please do not upload or remove).png
Random image
[edit source]Example:
Displays one random image from the given category, formatted to display the image itself. Note that if only a small number of images exist, the likelihood of frequent repeats on page refresh is much, much higher.
{{#dpl:
|category=Images:Fruit
|randomcount=1
|format=,[[File:%TITLE%,{{!}}30px]]
|allowcachedresults=no
}}
