Controlling output order: Difference between revisions

m
Minor cleanup
imported>FrozenPlum
mNo edit summary
imported>FrozenPlum
m (Minor cleanup)
 
(One intermediate revision by the same user not shown)
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 115:
 
 
'''Example:'''<br><br><!-- transclude example from subpage-->{{#lsth:{{PAGENAME}}Examples/Parameter:_ordermethod_ ordermethod (example 1)|Example}}
{{ViewTest|Examples|Parameter: ordermethod (example 1)}}
{{example|ordermethod|eg=1}}
 
'''Result:'''<br><!-- transclude example from subpage-->{{#lsth:{{PAGENAME}}Examples/Parameter:_ordermethod_ ordermethod (example 1)|Result}}
 
 
Line 132:
 
''orderdirection'' can be one of:
* ''descending'' — dependingDepending on the critriacriteria set, largest to smallest, most to least, 9 to 0 and/or Z to A
* ''ascending'' — dependingDepending on the critriacriteria set, smallest to largest, least to most, 0 to 9 and/or A to Z — ('''default''', needsneed not be set)
 
 
'''Example:'''<br><br><!-- transclude example from subpage-->{{#lsth:{{PAGENAME}}Examples/Parameter:_order_ order (example 1)|Example}}
{{ViewTest|Examples|Parameter: order (example 1)}}
{{example|order|eg=1}}
 
 
'''Result:'''<br><!-- transclude example from subpage-->{{#lsth:{{PAGENAME}}Examples/Parameter:_order_ order (example 1)|Result}}
 
 
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 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>.
 
==Other ways to sort==
 
===tablesortcol===
{{#lsth:Controlling output formatExamples|tablesortcol}}<!-- transclude from other page -->
 
===Using javascriptJavaScript===
 
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 alphabeticalphabetical 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:
Anonymous user