Images used (examples): Difference between revisions
m (→top: clean up, replaced: [[pt::Extension:{{subst:BASEPAGENAME}}]] → [[pt:Extensão:{{subst:BASEPAGENAME}}]]) |
imported>FrozenPlum m (→Random image: Needs cache bypass) |
||
(21 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{DPL manual|section=Examples|subsection= |
{{DPL manual|section=Examples|subsection=Images used}} |
||
==Gallery syntax== |
|||
The following example: |
|||
'''Example:'''<br><br><!-- transclude example from subpage-->{{#lsth:Controlling output format/Parameter: format (example 4)|Example}} |
|||
{{example|base=Controlling output format|format|eg=4}} |
|||
'''Result:'''<br><!-- transclude example from subpage-->{{#lsth:Controlling output format/Parameter: format (example 4)|Result}} |
|||
<pre><nowiki>{{#dpl: |
|||
imagecontainer=Watchlist |
|||
|format=,\n[[File:%PAGE%]]\n, |
|||
}}</nowiki></pre> |
|||
The '''same result''' can be achieved with parser ''extension'' syntax, as seen below. |
|||
Would display all images used on the Watchlist article page: |
|||
'''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><!-- transclude example from subpage-->{{#lsth:Criteria for page selection/Parameter: imagecontainer (example 1)|Example}} |
|||
{{example|base=Criteria for page selection|imagecontainer|eg=1}} |
|||
'''Result:'''<br><!-- transclude example from subpage-->{{#lsth:Criteria for page selection/Parameter: imagecontainer (example 1)|Result}} |
|||
'''Example:'''<br> |
|||
This lists images used in the [[Apple]] article and uses the <code>format</code> parameter to format the resulting file link as a [[mw:Help:Images|rendered image]] |
|||
<pre> |
|||
{{#dpl: |
{{#dpl: |
||
imagecontainer= |
|imagecontainer = Apple |
||
|format=, |
|format = ,[[File:%TITLE%|40px]] |
||
}} |
}} |
||
</pre> |
|||
'''Result:'''<br> |
|||
<!-- Extension prefix in other languages: |
|||
{{#dpl: |
|||
|imagecontainer = Apple |
|||
|format = ,[[File:%TITLE%|40px]] |
|||
}} |
|||
==List images used (existing or not)== |
|||
'''Example''':<br> |
|||
Lists all images used in the ''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 = Orange |
|||
|openreferences=true |
|||
}} |
|||
</pre> |
|||
'''Result:''' |
|||
{{#dpl: |
|||
|imagecontainer = Orange |
|||
|openreferences=true |
|||
}} |
|||
==Display images used== |
|||
'''Example:'''<br> |
|||
Lists all images used in the ''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]. Using <code>escapelinks=false</code> would display the image at full size, except formatting the output using <code>format=</code> allows control over the result, including display size. |
|||
<pre> |
|||
{{#dpl: |
|||
|imagecontainer = Orange |
|||
|openreferences=true |
|||
|escapelinks=false |
|||
|format=,[[%PAGE%,{{!}}50px]], |
|||
}} |
|||
</pre> |
|||
'''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]] |
|||
[[de:Erweiterung:{{subst:BASEPAGENAME}}]] |
|||
[[es:Extensión:{{subst:BASEPAGENAME}}]] |
|||
[[fr:Extension:{{subst:BASEPAGENAME}}]] |
|||
[[it:Estensione:{{subst:BASEPAGENAME}}]] |
|||
[[nl:Uitbreiding:{{subst:BASEPAGENAME}}]] |
|||
[[pl:Rozszerzenie:{{subst:BASEPAGENAME}}]] |
|||
[[pt:Extensão:{{subst:BASEPAGENAME}}]] |
|||
[[ru:Расширение:{{subst:BASEPAGENAME}}]] |
|||
[[zh:Extension::{{subst:BASEPAGENAME}}]] |
|||
--> |
Latest revision as of 20:42, 21 April 2023
|
Manual | Examples | Images used |
Gallery syntax
Example:
{{#lsth:Controlling output format/Parameter: format (example 4)|Example}}
Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Controlling output format/Parameter: format (example 4)|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
Example:
{{#lsth:Criteria for page selection/Parameter: imagecontainer (example 1)|Example}}
Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result:
{{#lsth:Criteria for page selection/Parameter: imagecontainer (example 1)|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]] }}
Result:
{{#dpl:
|imagecontainer = Apple
|format = ,File:%TITLE%
}}
List images used (existing or not)
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:
{{#dpl:
|imagecontainer = Orange
|openreferences=true
}}
Display images used
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:
{{#dpl: |imagecontainer = Orange |openreferences=true |escapelinks=false |format=,50px, }}
Random image
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 }}
Result: {{#dpl: |category=Images:Fruit |randomcount=1 |format=,File:%TITLE%, |allowcachedresults=no }}