Anonymous user
Controlling output order: Difference between revisions
m
Minor cleanup
imported>FrozenPlum (Update lsth links) |
imported>FrozenPlum m (Minor cleanup) |
||
Line 26:
|-
|'''''categoryadd'''''
|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.}}
|-
Line 40:
|-
|'''''lastedit'''''
|Orders list based on the most recent edit to the pages.
|-
|'''''pagetouched'''''
|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'''''
Line 132:
''orderdirection'' can be one of:
* ''descending'' —
* ''ascending'' —
Line 157:
* 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.
* A
==Other ways to sort==
Line 164:
{{#lsth:Examples|tablesortcol}}<!-- transclude from other page -->
===Using
In some cases, DPL3 sorting features are sufficient; think of the following example:
Line 173:
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
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:
|