Images used (examples): Difference between revisions

m
→‎Random image: Needs cache bypass
imported>FrozenPlum
m (Adjust a few things before moving)
imported>FrozenPlum
m (→‎Random image: Needs cache bypass)
 
(9 intermediate revisions by the same user not shown)
Line 1:
{{DPL manual|section=Examples|subsection=Display imagesImages used}}
{{purgenote}}
{{DPL manual|section=Examples|subsection=Display images used}}
 
==Gallery syntax==
Line 8 ⟶ 7:
'''Result:'''<br><!-- transclude example from subpage-->{{#lsth:Controlling output format/Parameter: format (example 4)|Result}}
 
The '''same result''' can be achieved with parser ''extension'' syntax, as seen below.
 
'''Example:'''
<pre>
<dpl>
namespace = File
count = 3
format = <gallery mode="packed" widths="80px" heights="80px">,%PAGE%\n,,</gallery>
</dpl>
</pre>
 
==Images contained in article==
'''Example:'''<br><br><!-- transclude example from subpage-->{{#lsth:Criteria for page selection/Parameter: imagecontainer (example 1)|Example}}
{{example|base=Criteria for page selection|imagecontainer|eg=1}}
 
Line 32 ⟶ 41:
 
==List images used (existing or not)==
'''Example''':<br>
Lists all images used in the two ''Apple'' and ''Orange'' articles. <code>openreferences=true</code> lists non-existing images, including those not housed locally, such as images used from [https://meta.wikimedia.org/wiki/Wikimedia_Commons Wikimedia Commons]. Non-existing images are displayed as red links.
 
<pre>
{{#dpl:
|imagecontainer = Apple¦GrapeOrange
|openreferences=true
}}
</pre>
 
Lists all images used in the two ''Apple'' and ''Orange'' articles. <code>openreferences=true</code> lists non-existing images, including those not housed locally, such as images used from [https://meta.wikimedia.org/wiki/Wikimedia_Commons Wikimedia Commons]. Non-existing images are displayed as red links.
 
{{tempnote}}
'''Result:'''
{{#dpl:
|imagecontainer = Orange
|openreferences=true
}}
 
==Display images used==
'''Example:'''<br>
Lists all images used in the two ''Apple'' and ''Orange'' articles. <code>openreferences=true</code> lists non-existing images, including those not housed locally, such as images used from [https://meta.wikimedia.org/wiki/Wikimedia_Commons Wikimedia Commons]. SettingUsing <code>escapelinks=false</code> would display the parameterimage ''escapelinks''at tofull falsesize, causesexcept formatting the displayoutput ofusing existing<code>format=</code> imagesallows directly,control ratherover thanthe listingresult, theirincluding namesdisplay size.
 
<pre>
{{#dpl:
|imagecontainer = Apple¦GrapeOrange
|openreferences=true
|escapelinks=false
|format=,[[%PAGE%,{{!}}50px]],
}}
</pre>
 
{{tempnote}}
Lists all images used in the two ''Apple'' and ''Orange'' articles. <code>openreferences=true</code> lists non-existing images, including those not housed locally, such as images used from [https://meta.wikimedia.org/wiki/Wikimedia_Commons Wikimedia Commons]. Setting the parameter ''escapelinks'' to false, causes the display of existing images directly, rather than listing their names.
 
'''Result:'''
 
{{#dpl:
|imagecontainer = Orange
|openreferences=true
|escapelinks=false
|format=,[[%PAGE%,{{!}}50px]],
}}
 
==Random image==
'''Example:'''<br>
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.
<pre>
{{#dpl:
|category=Images:Fruit
|randomcount=1
|format=,[[File:%TITLE%,{{!}}30px]]
|allowcachedresults=no
}}
</pre>
 
'''Result:'''
{{#dpl:
|category=Images:Fruit
|randomcount=1
|format=,[[File:%TITLE%,{{!}}30px]]
|allowcachedresults=no
}}
 
[[Category:Miscellaneous examples]]
Anonymous user