Help:Default Sorting

From OutHistory
Revision as of 17:12, 2 August 2008 by LaurenGutterman (talk | contribs)
Jump to navigationJump to search

This page has been edited from Wikipedia.

What is a default sort key?

A page's default sort key, {{DEFAULT SORT}}, establishes the way that page will be alphabetized on the category pages to which it is linked. If a default sort ket is not specified, the default sort key is the article title. It is therefore not technically necessary to provide a {{DEFAULTSORT}} value if the article title is the desired default sort key.

In some cases, alphabetizing an article by its title does not make sense. For example, an article such as The Sex Wars, 1970s to 1980s would automatically be alphabetized on its category pages under T rather than S. To solve this problem simply write Template:DEFAULT SORT: Sex Wars, 1970s to 1980s above the categories listed on that page.

Similarly, pages about a person, such as , would be alphabetized by the person's first rather than last name.


Setting a default sort key

The default sort key of a page for categories can be changed using the Template:DEFAULTSORT magic word. For instance, on George Washington, would cause to be equivalent to, not. This is especially useful when the article belongs in many categories. If more than one default sort key magic word is present on a page, the last occurrence is the one used. The Template:DEFAULTSORT magic word affects all categories that the article is in, regardless of the position of the magic word relative to the category. It does not just affect subsequent categories. The default sort key can be overridden for individual categories applied to an article by manually applying a sort key.

However, it is still a good idea to provide an explicit Template:DEFAULTSORT in these cases. Explicitly stating a default sort key is preferable to having no default sort key, as this leaves a record of the decision that the title is the sort key. Leaving it blank means that later editors cannot tell which articles have been checked for default sort and which have not.

Some editing tools, notably AWB, will attempt to infer an appropriate Template:DEFAULTSORT value if one is not provided. For example, the most appropriate default sort key for Acacia acanthoclada is the article title, yet that article is also in Category:Acacia with the sort key "Acanthoclada". If "Acacia acanthoclada" is not explicitly declared the default sort key, then AWB may declare the default sort key to be "Acanthoclada". There are also several bots that add DEFAULTSORT if existing category sort keys are in agreement, and remove the un-needed category sort keys: see the requests for approval for SmackBot XIII and BOTijo 5. An easy way of overriding the magic word and using the current article name as the sort key is to use the Default Sorting template after the pipe, e.g.. Using this template will cause the article to appear in the position appropriate to its full article name if the article is moved. Many templates that add the article to categories already do this, for instance the magic word does not affect Wikipedia article categories such as Category:Items to be merged when introduced by the Template:Merge template. The default sort magic word is sometimes mistaken as a template. Template:DEFAULTSORT exists to correct such mistakes, but it should not be used. All transclusions of the template in articles should eventually be replaced by the magic word. In other words, is correct, but Template:DEFAULTSORT is incorrect and should not be used. [edit]Priority sort keys It is possible to force an article or subcategory to the top of the list by using a non-alphanumeric character as the first after the pipe. For example, using (note the space) or would force that article to be displayed before all the others. Many editors feel that the space character produces the best aesthetic appearance when the category is displayed. Using a space or asterisk after the pipe is the customary way to categorize an article in a category with the same name, indicating that the article is the main topic article for that specific category. For an example, see Category:Suspension bridges. Using Template:Catmore may be preferable - no consensus has been established yet. To list at the end (after z) of a category, the sort key ~ can be used. </nowiki>