Controlling output order: Difference between revisions
Content deleted Content added
imported>FrozenPlum LS transclude tablesortcol section from Controlling Output Format page to Controlling output order, since it deals with order as well as format. |
imported>FrozenPlum m Minor cleanup |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1:
{{DPL manual|section=Parameters|subsection=Controlling output order}}
{{tocright}}
Line 27 ⟶ 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 41 ⟶ 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 116 ⟶ 115:
'''Example:'''<br><br><!-- transclude example from subpage-->{{#lsth:
{{ViewTest|Examples|Parameter: ordermethod (example 1)}}
'''Result:'''<br><!-- transclude example from subpage-->{{#lsth:
Line 133 ⟶ 132:
''orderdirection'' can be one of:
* ''descending'' —
* ''ascending'' —
'''Example:'''<br><br><!-- transclude example from subpage-->{{#lsth:
{{ViewTest|Examples|Parameter: order (example 1)}}
'''Result:'''<br><!-- transclude example from subpage-->{{#lsth:
Line 158 ⟶ 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==
===tablesortcol===
{{#lsth:
===Using
In some cases, DPL3 sorting features are sufficient; think of the following example:
Line 174 ⟶ 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:
|