Examples/Parameter: mode (example 2): 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== This list will output pages that have 'Appl' in their name; pages will...")
 
imported>FrozenPlum
m (Convert to parser function syntax, refine and flesh out a bit better since there was no differentiation of the two title vs titlewithoutnamespace option (there's some finer implications that aren't immediately evident))
Line 6: Line 6:
==Example==
==Example==


This list will output pages that have 'Appl' in their name; pages will be ordered by their name regardless of category, the output will be shown in category style (i.e., organized alphabetically displaying category-style capital letters).
This will match/list articles that have 'Appl' in their name, excluding subpages; pages will be ordered by their name regardless of category, and the output will be shown in category style (i.e., organized alphabetically displaying category-style capital letters) because of the <code>mode</code> parameter. An <code>{{DPL|ordermethod}}</code> is required when <code>mode=category</code> is set (so DPL3 knows how to order the category listing style), and the ''titlewithoutnamespace'' value makes the first letter of the page title used as the category heading. Note that using ''title'' instead would cause use of the first letter of the namespace if it exists, and just the title if it doesn't (such as for pages in the ''Main'' namespace).


<pre>
<pre>
<dpl>
{{#dpl:
titlematch=%Appl%
|titlematch = %Appl%
includesubpages=false
|includesubpages = false
mode=category
|mode = category
ordermethod=titlewithoutnamespace
|ordermethod = titlewithoutnamespace
|count = 3
</dpl>
}}
</pre>
</pre>


==Result==
==Result==


<dpl>
{{#dpl:
titlematch=%Appl%
|titlematch = %Appl%
includesubpages=false
|includesubpages = false
mode=category
|mode = category
ordermethod=titlewithoutnamespace
|ordermethod = titlewithoutnamespace
|count = 3
</dpl>
}}

<noinclude>
<noinclude>
[[Category:Setting the basic output mode]]
[[Category:Setting the basic output mode]]
Line 32: Line 33:
[[Category:Uses mode parameter]]
[[Category:Uses mode parameter]]
[[Category:Uses ordermethod parameter]]
[[Category:Uses ordermethod parameter]]
[[Category:Uses count parameter]]
</noinclude>
</noinclude>

Revision as of 04:53, 23 April 2022

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

Example

This will match/list articles that have 'Appl' in their name, excluding subpages; pages will be ordered by their name regardless of category, and the output will be shown in category style (i.e., organized alphabetically displaying category-style capital letters) because of the mode parameter. An ordermethod is required when mode=category is set (so DPL3 knows how to order the category listing style), and the titlewithoutnamespace value makes the first letter of the page title used as the category heading. Note that using title instead would cause use of the first letter of the namespace if it exists, and just the title if it doesn't (such as for pages in the Main namespace).

{{#dpl:
|titlematch      = %Appl%
|includesubpages = false
|mode            = category
|ordermethod     = titlewithoutnamespace
|count           = 3
}}

Result

{{#dpl: |titlematch = %Appl% |includesubpages = false |mode = category |ordermethod = titlewithoutnamespace |count = 3 }}