Controlling output order: Difference between revisions

Content added Content deleted
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.)
imported>FrozenPlum
m (Fix the ordermethod text running together and being silly to read. This is far easier to read. I spent so long on some of the difficult to figure out examples that it's now past my bed time)
Line 35: Line 35:




'''''methodN''''' can be one of the following single tokens:
'''''methodN''''' can be one of the following '''single''' values:


{| class="wikitable"
! Method
! Description
|-
|'''''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).
{{note|'''Note:''' Requires the [[mw:Extension:HitCounters|HitCounters]] extension for wikis on MediaWiki 1.25.0 or higher since the counter feature was removed<ref>[https://www.mediawiki.org/wiki/Manual:$wgDisableCounters Manual:$wgDisableCounters]</ref>; this extension is not yet available on Miraheze wikis.}}
|-
|'''''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 [[mw:Page_table|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 <code>linksfrom</code> or <code>linksto</code> statement. ''pagesel'' only makes sense if there is more than one page mentioned in the <code>linksfrom</code> or <code>linksto</code> condition.
|-
|'''''title'''''
|Outputs list sorted by article (prefix +) title.
|-
|'''''titlewithoutnamespace'''''
|Outputs list sorted by the article name regardless of namespace.
|-
|'''''sortkey'''''
|Outputs list sorted by title and [[mw:Help:Categories#Sort key|sortkey]], requires at least one category statement and a sortkey must be set on at least one of the output pages.
|-
|'''''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)'''.
|}


;''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) : '''Attention:''' Requires the [https://www.mediawiki.org/wiki/Extension:HitCounters HitCounter Extension] for wikis on MediaWiki 1.25.0 or higher since the counter feature was removed<ref>[https://www.mediawiki.org/wiki/Manual:$wgDisableCounters Manual:$wgDisableCounters]</ref>.
;''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 [[mw:Page_table|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 <code>linksfrom</code> or <code>linksto</code> statement. ''pagesel'' only makes sense if there is more than one page mentioned in the <code>linksfrom</code> or <code>linksto</code> condition.
;''title'': outputs list sorted by article (prefix +) title
;''titlewithoutnamespace'': outputs list sorted by the article name regardless of namespace


''methodN'' can also be one of the following token combinations (see also [[Controlling output format#headingmode|''headingmode'']] option):
'''''methodN''''' can also be one of the following '''combination''' of values (see also [[Controlling output format#headingmode|''headingmode'']] option):


{| class="wikitable"
;''category,firstedit'': outputs list sorted by category, then by first edit
! Method
;''category,lastedit'': outputs list sorted by category, then by last edit within a category
! Description
;''category,pagetouched'': outputs list sorted by category, then by pagetouched
|-
;''category,sortkey''
|'''''category,firstedit'''''
;''sortkey'': outputs list sorted by title and [[mw:Help:Categories#Sort key|sortkey]], requires at least one category statement and a sortkey must be set on at least one of the output pages
;''user,firstedit'': outputs list sorted by user, then by firstedit by the user
|Outputs list sorted by category, then by first edit.
|-
;''user,lastedit'': outputs list sorted by user, then by lastedit by the user
|'''''category,lastedit'''''

|Outputs list sorted by category, then by last edit within a category.
;''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)'''
|-
|'''''category,pagetouched'''''
|Outputs list sorted by category, then by pagetouched.
|-
|'''''category,sortkey'''''
|Outputs list sorted by title and [[mw:Help:Categories#Sort key|sortkey]], requires at least one category statement and a sortkey must be set on at least one of the output pages.
|-
|'''''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.
|}