Controlling output order: Difference between revisions

Content added Content deleted
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: 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.
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==
==ordermethod==
Line 28: Line 29:
}}
}}



Syntax:
'''Syntax:'''


<code>ordermethod=<i>method1,method2,...</i></code> means ordered by method1 first, then by method2, etc. (like the ORDER BY clause in SQL)
<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:
'''''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)
;''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: Line 58:
;''user,lastedit'': outputs list sorted by user, then by lastedit by the user
;''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)'''
;''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'''. '''(default)'''



Example:
'''Example:'''<br>


<pre><nowiki>
<pre><nowiki>
Line 66: Line 71:


This list will output pages that have <nowiki>[[Category:Africa]]</nowiki> showing most recently edited articles at the top.
This list will output pages that have <nowiki>[[Category:Africa]]</nowiki> showing most recently edited articles at the top.



==order==
==order==
Line 74: Line 80:
}}
}}



Example:
'''Syntax:'''<br>


<code>order=<i>orderdirection</i></code>
<code>order=<i>orderdirection</i></code>


''orderdirection'' can be one of:
''orderdirection'' can be one of:
* ''descending'' &mdash; outputs list from most recent to least recent
* ''descending''
* ''ascending'' &mdash; outputs list from least recent to most recent &mdash; '''(default)'''
* ''ascending'' '''(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>
<pre><nowiki>
Line 95: Line 109:
This list will output pages that have <nowiki>[[Category:Africa]]</nowiki> shown, ordered from oldest to newest.
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.
In addition, the edit date will be presented with each article.



==ordercollation==
==ordercollation==
Line 107: Line 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>.
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>
<code>ordercollation=<i>latin1_german_ci</i></code>