Controlling output order: Difference between revisions

Content added Content deleted
imported>FrozenPlum
(Update lsth links)
imported>FrozenPlum
m (Minor cleanup)
 
Line 26: Line 26:
|-
|-
|'''''categoryadd'''''
|'''''categoryadd'''''
|Orders list based on most recent addition to the category specified (requires the 'category' parameter, only one category can be included to work).
|Orders list based on the most recent addition to the category specified (requires the 'category' parameter, only one category can be included to work).
{{note|See '''''sortkey''''' for sorting by page order in a category.}}
{{note|See '''''sortkey''''' for sorting by page order in a category.}}
|-
|-
Line 40: Line 40:
|-
|-
|'''''lastedit'''''
|'''''lastedit'''''
|Orders list based on most recent edit to the pages.
|Orders list based on the most recent edit to the pages.
|-
|-
|'''''pagetouched'''''
|'''''pagetouched'''''
|Orders list based on 'page_touched' timestamp. Read comment on page_touched field in [[mw:Page_table|Page_table]] to see the difference from most recent edit by an author.
|Orders list based on 'page_touched' timestamp. Read the comment on the page_touched field in [[mw:Page_table|Page_table]] to see the difference from most recent edit by an author.
|-
|-
|'''''pagesel'''''
|'''''pagesel'''''
Line 132: Line 132:


''orderdirection'' can be one of:
''orderdirection'' can be one of:
* ''descending'' — depending on the critria set, largest to smallest, most to least, 9 to 0 and/or Z to A
* ''descending'' — Depending on the criteria set, largest to smallest, most to least, 9 to 0 and/or Z to A
* ''ascending'' — depending on the critria set, smallest to largest, least to most, 0 to 9 and/or A to Z — ('''default''', needs not be set)
* ''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)




Line 157: Line 157:
* For case insensitivity during the ''selection'' of articles, see {{DPL|ignorecase}}.
* For case insensitivity during the ''selection'' of articles, see {{DPL|ignorecase}}.
* 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 spelled correctly. Otherwise, you will see a SQL error message.
* 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 spelled correctly. Otherwise, you will see a SQL error message.
* A very 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 <code>ordercollation=bridge</code>.
* 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 <code>ordercollation=bridge</code>.


==Other ways to sort==
==Other ways to sort==
Line 164: Line 164:
{{#lsth:Examples|tablesortcol}}<!-- transclude from other page -->
{{#lsth:Examples|tablesortcol}}<!-- transclude from other page -->


===Using javascript===
===Using JavaScript===


In some cases, DPL3 sorting features are sufficient; think of the following example:
In some cases, DPL3 sorting features are sufficient; think of the following example:
Line 173: Line 173:


But there is another way:
But there is another way:
* Create a ''sortable wiki table'' (using the {{DPL|table}} option of DPL3 with <code>class="wikitable sortable"</code>) 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 alphabetic order of the page names).
* Create a ''sortable wiki table'' (using the {{DPL|table}} option of DPL3 with <code>class="wikitable sortable"</code>) 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:
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: