Template:DateSort: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
m (Robot: Automated text replacement (-\=( {2})([0-9][0-9])\r += 0\2))
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>{{#switch:{{PAGENAME}}
{#switch: {{da|{{PAGENAME}}}}
   |  1 January |  1 January  (production) |  1 January  (releases) |  1 January  (people) = 001
   |  1 January |  1 January  (production) |  1 January  (releases) |  1 January  (people) = 001
   |  2 January |  2 January  (production) |  2 January  (releases) |  2 January  (people) = 002
   |  2 January |  2 January  (production) |  2 January  (releases) |  2 January  (people) = 002

Revision as of 16:30, 11 June 2013

Instructions for {{DateSort}}
{{DateSort}} — like its sister templates, {{NameSort}} and {{TitleSort}} — allows for apparently automatic sorting of pages. It uses the magic word, DEFAULTSORT, along with a #switch, to convert a day of the year to a number from 1 to 365 (29 February sharing the same number as 28 February), thus allowing day of the year pages to sort numerically.

Usage

Usage is super easy. Just type {{DateSort}} at the bottom of a page. Then, when you add categories to the page you no longer have to define the sort key for every individual category. It will automatically sort the person by their numerical ID.