Examples/Parameter: format (example 1): Difference between revisions

From DynamicPageList3 Manual
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
m (FrozenPlum moved page Controlling output format/Parameter: format (example 1) to Examples/Parameter: format (example 1): Simplifying how things are structured)
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
==Example==
==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.
The classical default output of DPL can be produced by using a default statement, or by using the {{DPL|format}} with the following statements:


<pre>
{| style="border-spacing: 10px 0;"
{{#dpl:
| align=center| '''default''' || align=center| '''formatted'''
|titlematch = %ntries%
|- style="vertical-align:top;"
|nottitlematch = %f%
|<pre><nowiki>
|includesubpages = false
<dpl>
|count = 3
titlematch = %ntries%
}}
nottitlematch = %f%
</pre>
includesubpages = false
</dpl>
<pre>
{{#dpl:
</nowiki></pre>
|titlematch = %ntries%
|<pre><nowiki>
|nottitlematch = %f%
<dpl>
|includesubpages = false
titlematch = %ntries%
|format = ,\n* [[%PAGE%|%TITLE%]],,
nottitlematch = %f%
|count = 3
includesubpages = false
}}
format = ,\n* [[%PAGE%]],,
</dpl>
</pre>
==Result==
</nowiki></pre>
{{#dpl:
|-
|titlematch = %ntries%
|<dpl>
titlematch = %ntries%
|nottitlematch = %f%
|includesubpages = false
nottitlematch = %f%
|count = 3
includesubpages = false
}}
</dpl>
----
|<dpl>
{{#dpl:
titlematch = %ntries%
|titlematch = %ntries%
nottitlematch = %f%
|nottitlematch = %f%
includesubpages = false
|includesubpages = false
format = ,\n* [[%PAGE%]],,
|format = ,\n* [[%PAGE%|%TITLE%]],,
</dpl>
|count = 3
|}
}}
<noinclude>
<noinclude>
[[Category:Setting the basic output mode]]
[[Category:Setting the basic output mode]]
Line 45: Line 46:
[[Category:Uses includesubpages parameter]]
[[Category:Uses includesubpages parameter]]
[[Category:Uses format parameter]]
[[Category:Uses format parameter]]
[[Category:Uses count parameter]]
</noinclude>
</noinclude>

Latest revision as of 23:54, 31 March 2023

Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

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. The format statement's Startall, End, and Endall arguments are empty, only Start is used to manually define a bulleted list followed by the liked page name, which is then applied to each row of output.

{{#dpl:
|titlematch      = %ntries%
|nottitlematch	 = %f%
|includesubpages = false
|count           = 3
}}
{{#dpl:
|titlematch      = %ntries%
|nottitlematch	 = %f%
|includesubpages = false
|format	         = ,\n* [[%PAGE%|%TITLE%]],,
|count           = 3
}}

Result

{{#dpl: |titlematch = %ntries% |nottitlematch = %f% |includesubpages = false |count = 3 }}


{{#dpl: |titlematch = %ntries% |nottitlematch = %f% |includesubpages = false |format = ,\n* %TITLE%,, |count = 3 }}