Examples/Parameter: format (example 4): Difference between revisions
< Examples
Content added Content deleted
imported>FrozenPlum (Created page with "<noinclude>{{note|Please '''do not edit''' this page unless you're wanting to edit the manual itself, it is an example included in the manual.|error}}</noinclude><!-- This is the example preloaded for testing, press "Show Preview" to see the example working (at the bottom of the page). If you save this page, it saves as a new section at the bottom of your '''User:Username/Sandbox''' --> ==Example== This would list items in the ''File'' namespace, limited to a count of...") |
imported>FrozenPlum (Formatting tweaks) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{noedit}}</noinclude><!-- |
|||
<noinclude>{{note|Please '''do not edit''' this page unless you're wanting to edit the manual itself, it is an example included in the manual.|error}}</noinclude><!-- |
|||
This is the example preloaded for testing, press "Show Preview" to see |
This is the example preloaded for testing, press "Show Preview" to see |
||
the example working (at the bottom of the page). If you save this page, |
the example working (at the bottom of the page). If you save this page, |
||
Line 6: | Line 6: | ||
==Example== |
==Example== |
||
This would list items in the ''File'' namespace |
This would list items in the ''File'' namespace, formatted as a gallery using the {{tt|Startall}} and {{tt|Endall}} arguments of the {{DPL|format}} syntax to specify gallery start and end. The {{tt|Start}} and {{tt|End}} arguments are then applied to each result, so the file page names are fetched for each image, and put on a new line to complete the gallery statement. |
||
'''Note:''' When DPL3 parser function syntax is used to create a gallery, the <code><</code> and <code>></code> characters must be replaced by <code>«</code> and <code>»</code> respectively (to escape them). |
|||
<pre> |
<pre> |
||
{{#dpl: |
|||
|namespace = File |
|||
⚫ | |||
|count = 3 |
|||
⚫ | |||
}} |
|||
</dpl> |
|||
</pre> |
</pre> |
||
==Result== |
==Result== |
||
{{#dpl: |
|||
|namespace = File |
|||
⚫ | |||
|count = 3 |
|||
⚫ | |||
}} |
|||
</dpl> |
|||
<noinclude> |
<noinclude> |
||
[[Category:Setting the basic output mode]] |
[[Category:Setting the basic output mode]] |
Latest revision as of 05:11, 1 April 2023
Example
This would list items in the File namespace, formatted as a gallery using the Startall and Endall arguments of the format syntax to specify gallery start and end. The Start and End arguments are then applied to each result, so the file page names are fetched for each image, and put on a new line to complete the gallery statement.
Note: When DPL3 parser function syntax is used to create a gallery, the <
and >
characters must be replaced by «
and »
respectively (to escape them).
{{#dpl: |namespace = File |format = «gallery mode="packed" widths="80px" heights="80px"»,%PAGE%\n,,«/gallery» |count = 3 }}
Result
{{#dpl: |namespace = File |format = «gallery mode="packed" widths="80px" heights="80px"»,%PAGE%\n,,«/gallery» |count = 3 }}