Examples/Parameter: format (example 1): 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== The classical default output of DPL can be produced by using a default...") |
imported>FrozenPlum No edit summary |
||
Line 6:
==Example==
The classical default output of DPL, an unordered (bulleted) list, can be produced by using a default statement
<pre>
▲<dpl>
|count = 3
▲ titlematch = %ntries%
▲ nottitlematch = %f%
▲ includesubpages = false
<
▲<dpl>
▲ titlematch = %ntries%
▲ nottitlematch = %f%
|count = 3
▲ includesubpages = false
}}
▲ format = ,\n* [[%PAGE%]],,
</
==Result==
▲|<dpl>
|includesubpages = false
nottitlematch = %f%▼
|count = 3
}}
▲</dpl>
----
▲ titlematch = %ntries%
|titlematch = %ntries%
|includesubpages = false
|count = 3
▲|}
}}
<noinclude>
[[Category:Setting the basic output mode]]
Line 45 ⟶ 46:
[[Category:Uses includesubpages parameter]]
[[Category:Uses format parameter]]
[[Category:Uses count parameter]]
</noinclude>
|
Revision as of 05:47, 23 April 2022
Example
The classical default output of DPL, an unordered (bulleted) list, can be produced by using a default statement (first example and result). It can also be created using format
with the following statements (last example and result). This selects pages that have "ntries" in the title, it excludes pages that have "f" in the title, and it also excludes subpages. Both outputs appear the same.
{{#dpl: |titlematch = %ntries% |nottitlematch = %f% |includesubpages = false |count = 3 }}
{{#dpl: |titlematch = %ntries% |nottitlematch = %f% |includesubpages = false |format = ,\n* [[%PAGE%]],, |count = 3 }}
Result
{{#dpl: |titlematch = %ntries% |nottitlematch = %f% |includesubpages = false |count = 3 }}
{{#dpl: |titlematch = %ntries% |nottitlematch = %f% |includesubpages = false |format = ,\n* %PAGE%,, |count = 3 }}