Controlling output order: Difference between revisions

m
Adjust the example, since it suggested order only applied to "most recent" and "least recent" in terms of "addeditdate" when it also applies to things like "title" but doesn't work alone for this, ordermethod=title is required if the selection criteria not based on title
imported>FrozenPlum
m (→‎order: remove description I added of this, I think I misunderstood its application)
imported>FrozenPlum
m (Adjust the example, since it suggested order only applied to "most recent" and "least recent" in terms of "addeditdate" when it also applies to things like "title" but doesn't work alone for this, ordermethod=title is required if the selection criteria not based on title)
Line 20:
 
Prior to 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.
 
 
==ordermethod==
Line 28 ⟶ 29:
}}
 
 
'''Syntax:'''
 
<code>ordermethod=<i>method1,method2,...</i></code> means ordered by method1 first, then by method2, etc. (like the ORDER BY clause in SQL)
 
 
'''''methodN''''' can be one of the following single tokens:
 
 
;''categoryadd'': outputs list based on most recent addition to the first category (requires to include one category and one only using 'category' parameter)
Line 54 ⟶ 58:
;''user,lastedit'': outputs list sorted by user, then by lastedit by the user
 
;''none'': do not apply any ordering (except ordering by timestamp if you requested a list of revisions); this method '''must be used when you specify '''openreferences=yes'''. &mdash; '''(default)'''
 
 
Example:
'''Example:'''<br>
 
<pre><nowiki>
Line 66 ⟶ 71:
 
This list will output pages that have <nowiki>[[Category:Africa]]</nowiki> showing most recently edited articles at the top.
 
 
==order==
Line 74 ⟶ 80:
}}
 
 
Example:
'''Syntax:'''<br>
 
<code>order=<i>orderdirection</i></code>
 
''orderdirection'' can be one of:
* ''descending'' &mdash; outputs list from most recent to least recent
* ''ascending'' &mdash; outputs list from least recent to most recent &mdash; '''(default)'''
 
 
Example:
If combined with <code>{{DPL|ordermethod}}</code>, the <code>''ascending''</code> and <code>''descending''</code> values can control the sort direction of some ordermethod values, such as <code>ordermethod=''title''</code>.
 
 
'''Example:'''
 
* ''descending'' &mdash; outputs list from most recent to least recent
* ''ascending'' &mdash; outputs list from least recent to most recent — '''(default)'''
 
<pre><nowiki>
Line 95 ⟶ 109:
This list will output pages that have <nowiki>[[Category:Africa]]</nowiki> shown, ordered from oldest to newest.
In addition, the edit date will be presented with each article.
 
 
==ordercollation==
Line 107 ⟶ 122:
Note: A very special (proprietory) 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>.
 
 
Example:
'''Example:'''<br>
 
<code>ordercollation=<i>latin1_german_ci</i></code>
Anonymous user