User:FrozenPlum/Sandbox: Difference between revisions

→‎randomcount: new section
imported>FrozenPlum
(Add an example, I did get another 503 while previewing this page)
 
imported>FrozenPlum
(→‎randomcount: new section)
 
(3 intermediate revisions by the same user not shown)
Line 9:
|titlematch=%
|lastrevisionbefore=3000
|listseparators=¶{¦class="wikitable sortable" ¶!Namespace ¶!Script ¶!Last ¶!By ¶!Size,¶¦-¶¦style="background:#e1f5fa;"¦%NAMESPACE% ¶¦[[%PAGE%]]¶¦%DATE%¶¦[[User:%USER%|%USER%]]¶¦%SIZE%,¶,¶¦}
|secseparators=\n¦
|count=3010
}}
 
<!--
This preloads the example for testing, press "Show Preview" to see the example work
If you save this page, it saves as a new section on your '''User:Username/Sandbox''' page.
-->
==Example==
<pre>
<dpl>
category=Countries in Africa|Countries in United Kingdom
category=Part of NATO
</dpl>
 
or
 
{{#dpl:
|category=Countries in Africa¦Countries in United Kingdom
|category=Part of NATO
}}
 
or
 
{{#dpl:
|category=Countries in Africa{{!}}Countries in United Kingdom
|category=Part of NATO
}}
</pre>
 
==Result==
{{#dpl:
|category=Countries in Africa{{!}}Countries in United Kingdom
|category=Part of NATO
}}
 
== format ==
 
<!--
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, an unordered (bulleted) list, can be produced by using a default statement (first example and result). It can also be created using <code>{{DPL|format}}</code> 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. The <code>format</code> statement's <code>''Startall''</code>, <code>''End''</code>, and <code>''Endall''</code> arguments are empty, only <code>''Start''</code> is used to manually define a bulleted list followed by the liked page name, which is then applied to each row of output.
 
<pre>
{{#dpl:
|titlematch = %ntries%
|nottitlematch = %f%
|includesubpages = false
|count = 3
}}
</pre>
<pre>
{{#dpl:
|titlematch = %ntries%
|nottitlematch = %f%
|includesubpages = false
|format = ,\n* [[%PAGE%]],,
|count = 3
}}
</pre>
==Result==
{{#dpl:
|titlematch = %ntries%
|nottitlematch = %f%
|includesubpages = false
|count = 3
}}
----
{{#dpl:
|titlematch = %ntries%
|nottitlematch = %f%
|includesubpages = false
|format = ,\n* [[%PAGE%]],,
|count = 3
}}
 
== randomcount ==
 
<!--
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 will list from [[:Category:Fruit examples]], three random articles ordered by size. Each time the page is previewed or refreshed, the results may randomly change.
 
<pre>
{{#dpl:
|category=Fruit examples
|randomcount=3
|ordermethod=size
|count=7
}}
</pre>
 
==Result==
 
{{#dpl:
|category=Fruit examples
|randomcount=3
|ordermethod=size
|count=7
}}
Anonymous user