Examples/Parameter: format (example 4)
Example
This would list items in the File namespace, limited to a count of 3, formatted as a gallery using the Startall
and Endall
positions of the format syntax to specify gallery start and end. Note that when DPL3 parser function syntax is used to create a gallery, which uses tag syntax, the <
and >
characters must be escaped, so each is replaced by «
and »
respectively. The Start
position in the syntax specifies the %PAGE%
(in this case the file page) followed by a line break \n
to populate the MediaWiki gallery syntax needed. The Start
and End
(empty, not required) parts of the syntax are applied to each result in the list, so the file page name is fetched for each image and put on a new line to complete the gallery statement. See gallery syntax on MediaWiki Wiki for more information on gallery syntax.
{{#dpl: |namespace = File |count = 3 |format = «gallery mode="packed" widths="80px" heights="80px"»,%PAGE%\n,,«/gallery» }}
Result
{{#dpl: |namespace = File |count = 3 |format = «gallery mode="packed" widths="80px" heights="80px"»,%PAGE%\n,,«/gallery» }}