Controlling output order: Difference between revisions

Content added Content deleted
imported>FrozenPlum
m (26 revisions imported: Imported from help.fandom.com, Extension:DPL3 pages, which are for the obsolete version of DPL3 extension for MediaWiki 1.33, to adapt to forked (newer) extension version.)
imported>FrozenPlum
mNo edit summary
Line 1: Line 1:
{{note|This page is in development, some content may be incorrect, outdated, or otherwise misleading. |warn}}
{{DPL manual|section=Parameters|subsection=Controlling output order}}
{{DPL manual|section=Parameters|subsection=Controlling output order}}


DPL3 allows you to define the sort order of its output as is explained below.
DPL3 allows you to define the sort order of its output, as is explained below.


In some cases this is not sufficient, however. Think of the following example: You create a list of pages which use a certain template. You want to show the value of the first parameter each page uses when calling that template. This can easily be done with the {{dpl3|include}} feature of DPL. If you now wanted the output to be sorted by the value of that parameter DPL could not help because it had to analyze all articles before finding those parameter values.
In some cases, this is not sufficient, however. Think of the following example: You create a list of pages which use a certain template. You want to show the value of the first parameter each page uses when calling that template. This can easily be done with the {{dpl3|include}} feature of DPL. If you now wanted the output to be sorted by the value of that parameter, DPL could not help because it had to analyze all articles before finding those parameter values.


But there is another way: Create a ''sortable wiki table'' (using the {{dpl3|table}} option of DPL with 'class=sortable') and you can click on the column headings to sort your output accordingly. However, the initial order shown in that table will still be the order in which DPL parsed the wiki pages (usually an alphabetic order of the page names).
But there is another way: Create a ''sortable wiki table'' (using the {{dpl3|table}} option of DPL with 'class=sortable') and you can click on the column headings to sort your output accordingly. However, the initial order shown in that table will still be the order in which DPL parsed the wiki pages (usually an alphabetic order of the page names).
Line 43: Line 44:
;''titlewithoutnamespace'': outputs list sorted by the article name regardless of namespace
;''titlewithoutnamespace'': outputs list sorted by the article name regardless of namespace


''methodN'' can also be one of the following token combinations (see also [[Extension:DPL3/Parameters: Controlling output format#headingmode|''headingmode'']] option):
''methodN'' can also be one of the following token combinations (see also [[Controlling output format#headingmode|''headingmode'']] option):


;''category,firstedit'': outputs list sorted by category, then by first edit
;''category,firstedit'': outputs list sorted by category, then by first edit
Line 92: Line 93:
</nowiki></pre>
</nowiki></pre>


This list will output pages that have <nowiki>[[Category:Africa]]</nowiki> shown ordered from oldest to newest.
This list will output pages that have <nowiki>[[Category:Africa]]</nowiki> shown, ordered from oldest to newest.
In addition the edit date will be presented with each article.
In addition, the edit date will be presented with each article.


==ordercollation==
==ordercollation==
Line 99: Line 100:
{{DPL Parameter
{{DPL Parameter
|name = ordercollation
|name = ordercollation
|purpose= Allow individual collations, make case insensitive sorting possible
|purpose= Allow individual collations, make case-insensitive sorting possible
}}
}}


Line 112: Line 113:
You may want to try <code>latin1_swedish_ci</code> or other collation mapping table names as well.
You may want to try <code>latin1_swedish_ci</code> or other collation mapping table names as well.


If you use a name for the first time you should make sure that it is correctly spelt. Otherwise you will see a SQL error message.
If you use a name for the first time, you should make sure that it is correctly spelt. Otherwise, you will see a SQL error message.


For case insensitivity during the ''selection'' of articles, see {{dpl3|ignorecase}}.
For case insensitivity during the ''selection'' of articles, see {{dpl3|ignorecase}}.
Line 118: Line 119:
==References==
==References==
<references />
<references />
[[Category:Primary Module]]

<!-- Extension prefix in other languages:

[[de:Erweiterung:{{subst:BASEPAGENAME}}]]
[[es:Extensión:{{subst:BASEPAGENAME}}]]
[[fr:Extension:{{subst:BASEPAGENAME}}]]
[[it:Estensione:{{subst:BASEPAGENAME}}]]
[[nl:Uitbreiding:{{subst:BASEPAGENAME}}]]
[[pl:Rozszerzenie:{{subst:BASEPAGENAME}}]]
[[pt:Extensão:{{subst:BASEPAGENAME}}]]
[[ru:Расширение:{{subst:BASEPAGENAME}}]]
[[zh:扩展:{{subst:BASEPAGENAME}}]]
-->