Help:Default Sorting

From OutHistory
Revision as of 18:03, 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. However, [[The Sex Wars, 1970s to 1980s]] == Setting a default sort key == The default sort key of a page for categories can be changed using the {{DEFAULTSORT}} magic word. For instance, on George Washington, {{DEFAULTSORT:Washington, George}} would cause [[Category:United States presidents]] to be equivalent to [[Category:United States presidents|Washington, George]], not [[Category:United States presidents|George Washington]]. 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 {{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 {{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 {{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 {{PAGENAME}} template after the pipe, e.g. [[CATEGORY:Articles ordered by name|{{PAGENAME}}]]. 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 {{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, {{DEFAULTSORT:Washington, George}} is correct, but {{DEFAULTSORT|Washington, George}} 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 [[Category:Ford| Ford Motor Company]] (note the space) or [[Category:Ford|*Ford Motor Company]] 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 {{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 [[Category:Polyhedra|~Polyhedra templates]].