Difference between revisions of "DPL:Manual - DPL parameters: Controlling output order"

From FollowTheScore
Jump to: navigation, search
(ordercollation)
Line 88: Line 88:
 
You may want to try <tt>latin1_swedish_ci</tt> or other collation mapping table names as well.
 
You may want to try <tt>latin1_swedish_ci</tt> or other collation mapping table names as well.
  
If you use a name for the first time you should set '''<tt>debug=4</tt>'''. This will help you to see the SQL code and SQL error messages in case the name you used is not available in that MySQL installation.
+
If you use a name for the first time you should make sure that it is correctly spelt. Otherwise you will see a SQL error message.

Revision as of 07:40, 26 September 2007

Template:Type:Manual

ordermethod

ordermethod Determines what criterium (resp. criteria) is (resp. are) used to order the list.

Syntax:

ordermethod=method1,method2,... means ordered by method1 first, then by method2, etc. (like the ORDER 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)
counter
outputs list based on the number of times the page has been viewed (by ~popularity)
size
outputs list based on the size of the article (bytes of wiki text)
firstedit
outputs list based on first edit to the pages (creation)
lastedit
outputs list based on most recent edit to the pages
pagetouched
outputs list based on 'page_touched' timestamp. Read comment on page_touched field in Page_table to see the difference from most recent edit by an author.
pagesel
outputs list based on the names of the reference pages which are used in the selection of a linksfrom or linksto statement. pagesel only makes sense if there is more than one page mentioned in the linksfrom or linksto condition.
title
outputs list sorted by article (prefix +) title — (default)
titlewithoutnamespace
outputs list sorted by the article name regardless of namespace

methodN can also be one of the following token combinations (see also headingmode option):

category,firstedit
outputs list sorted by category, then by first edit
category,lastedit
outputs list sorted by category, then by last edit within a category
category,pagetouched
outputs list sorted by category, then by pagetouched
category,sortkey
user,firstedit
outputs list sorted by user, then by firstedit by the user
user,lastedit
outputs list sorted by user, then by lastedit by the user

Example:

<DPL>
  category=Africa
  ordermethod=lastedit
</DPL>

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

order

order Controls the sort direction of the list.

Example:

order=orderdirection

orderdirection can be one of:

  • descending — outputs list from most recent to least recent
  • ascending — outputs list from least recent to most recent — (default)

Example:

<DPL>
  category    = Africa
  ordermethod = lastedit
  order       = ascending
  addeditdate = true
</DPL>

This list will output pages that have [[Category:Africa]] shown ordered from oldest to newest. In addition the edit date will be presented with each article.


ordercollation

ordercollation Allow individual collations, make case insensitive sorting possible

Example:

ordercollation=latin1_german_ci

You may want to try latin1_swedish_ci or other collation mapping table names as well.

If you use a name for the first time you should make sure that it is correctly spelt. Otherwise you will see a SQL error message.