Anonymous user
Controlling output order: Difference between revisions
m
Add a category sortkey, so these can be displayed in the correct order on the parameter quick reference page. I still need to go through this page (when I'm finished the others that are more complex) and do all the examples, plus more content fixes.
imported>FrozenPlum mNo edit summary |
imported>FrozenPlum m (Add a category sortkey, so these can be displayed in the correct order on the parameter quick reference page. I still need to go through this page (when I'm finished the others that are more complex) and do all the examples, plus more content fixes.) |
||
Line 8:
But there is another way: Create a ''sortable wiki table'' (using the {{DPL|table}} option of DPL with 'class=sortable') 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 DPL parsed the wiki pages (usually an alphabetic order of the page names).
Using a handful of
sortables_init();
Line 19:
ts_resortTable(lnk);
Line 81:
'''Syntax:''' <
''orderdirection'' can be one of:
Line 91 ⟶ 89:
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'' — outputs list from most recent to least recent
* ''ascending'' — outputs list from least recent to most recent — '''(default)'''
▲'''Example:'''
<pre>
{{#dpl:
|category = Africa
Line 105 ⟶ 102:
|addeditdate = true
}}
This
In addition, the edit date will be presented with each article.
Line 115 ⟶ 112:
{{DPL Parameter
|name = ordercollation
|purpose=
}}
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>.▼
<code>ordercollation=<i>latin1_german_ci</i></code>▼
▲'''Syntax:''' <code>ordercollation=<i>latin1_german_ci</i></code>
You may want to try <code>latin1_swedish_ci</code> or other collation mapping table names as well.▼
'''Notes:'''
* 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.
▲
==References==
<references />
[[Category:Primary Module|03]]
|