|
|
(25 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| + | This page has been edited from Wikipedia. |
| + | |
| + | |
| == What is a default sort key? == | | == What is a default sort key? == |
| | | |
− | The a page's default sort key establishes the words that will represent that page in a
| + | <nowiki>A page's default sort key, {{DEFAULTSORT}}, 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.</nowiki> |
| | | |
| | | |
| == Setting a default sort key == | | == 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.
| + | 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. <nowiki> To solve this problem simply write {{DEFAULTSORT: Sex Wars, 1970s to 1980s}} above the categories listed on that page. </nowiki> |
− | In the absence of a {{DEFAULTSORT}}, 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, 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.
| + | Even more importantly, pages about a person, such as [[George Eighmey]], would be alphabetized by the person's first rather than last name. <nowiki>To solve this problem write {{DEFAULTSORT:Eighmey, George}}</nowiki> above the categories listed on that page. |
− | 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]].
| + | |
| + | == See also == |
| + | |
| + | |
| + | [http://en.wikipedia.org/wiki/Wikipedia:Categorization#Other_requirements Wikipedia Category Sorting] |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | [[Category:Help Pages]] |
This page has been edited from Wikipedia.
What is a default sort key?
A page's default sort key, {{DEFAULTSORT}}, 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.
Setting a 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 {{DEFAULTSORT: Sex Wars, 1970s to 1980s}} above the categories listed on that page.
Even more importantly, pages about a person, such as George Eighmey, would be alphabetized by the person's first rather than last name. To solve this problem write {{DEFAULTSORT:Eighmey, George}} above the categories listed on that page.
See also
Wikipedia Category Sorting