Controlling output order

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

ordermethod
Syntax:

ordered by method1 first, then by method2, etc., (like the ORDER BY clause in SQL).

methodN can be one of the following single values (which will be sorted in ascending order by default, see ):

methodN can also be one of the following combination of values (which will be sorted in ascending order by default, see ):

Example:

Result:

order
Syntax:

orderdirection can be one of:
 * descending — Depending on the criteria set, largest to smallest, most to least, 9 to 0 and/or Z to A
 * ascending — Depending on the criteria set, smallest to largest, least to most, 0 to 9 and/or A to Z  — (default, need not be set)

Example:

Result:

ordercollation
Syntax:

Notes:
 * For case insensitivity during the selection of articles, see.
 * You may want to try  or other collation mapping table names as well. If you use a name for the first time, you should make sure that it is spelled correctly. Otherwise, you will see a SQL error message.
 * A special (proprietary) function can be used to sort card suit symbols according to the rank of suits that is used in the card game of bridge (this cannot be done by standard collating sequences). To trigger this function, set.

Using JavaScript
In some cases, DPL3 sorting features are sufficient; 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 feature of DPL.
 * If you now wanted the output to be sorted by the value of that parameter, DPL3 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 option of DPL3 with  ) 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 DPL3 parsed the wiki pages (usually an alphabetical order of the page names).

Using a handful of JavaScript lines, you can sort a wikitable on pageLoad by any column. You must insert that JavaScript code AT THE END of your page:

Before version 1.16 of MediaWiki, wikibits.js was typically called at the end of a page and performed sortables_init. Calling it explicitly did not result in it being recognized, but rather resulted in adding a second set of sort link buttons.