Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Understanding DEFAULTSORT  





2 Placement  





3 Tracking category  





4 See also  





5 TemplateData  














Template:DEFAULTSORT






العربية
Авар
تۆرکجه
Basa Bali

Català
Чӑвашла
Español
Esperanto
فارسی
Français

Gungbe
Hrvatski
Bahasa Indonesia
Jawa


Kurdî
Latviešu



Nāhuatl

Нохчийн
Norsk bokmål
ି
Oʻzbekcha / ўзбекча

پښتو

Română
Русский
Scots

Slovenščina
کوردی
Srpskohrvatski / српскохрватски
Tagalog
ி
 



Тоҷикӣ
Українська
اردو
Tiếng Vit

 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
Wikibooks
Wikiquote
Wikisource
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 



{{DEFAULTSORT:<sort key>}} is a magic word used to modify the sequence of pages shown on category pages. The given sort key in a specific page is used to determine that page's position in all category pages where the page is listed. Note: The specific page will still be listed with its original title, regardless of the modified sort order. The sort key can be overridden for specific categories, if their [[Category:]] tags contain a differing individual sort key.

It is not necessary to use DEFAULTSORT at all if the article or page should be alphabetized according to its title (which is true for most articles).

For background information on how the pages in a category are ordered, see Wikipedia:Categorization § Sort keys and Help:Category § Default sort key.

Understanding DEFAULTSORT

By default, pages listed on a category page are sorted by {{PAGENAME}}. It is possible to set a different sort key by using the {{DEFAULTSORT}} magic word.

In the case of multiple default sort key tags, the last DEFAULTSORT on the final rendering of a page applies for all categories, regardless of the position of the category tags. This also means that a DEFAULTSORT tag included from a template is not effective if another DEFAULTSORT tag occurs later on the page, even if the later DEFAULTSORT tag is also "hidden" (included by another template).

Placement

When using {{DEFAULTSORT}} to modify the default sort key, the magic word should be placed at the left margin of a new line, immediately above the line which begins the list of categories. For example, the last lines of a typical article titled Forename Surname could look like:

==Final section==
Final line of content in "final section".

{{Templates}}

{{Last metadata template
| LAST PARAMETER OF LAST METADATA TEMPLATE = Parameter content
}}
{{DEFAULTSORT:Surname, Forename}}
[[Category:Forename Surname| ]]

Tracking category

See also

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:DEFAULTSORT in articles based on its TemplateData.

TemplateData for DEFAULTSORT

{{DEFAULTSORT:<sort key>}} is a magic word used to modify the sequence of pages shown on category pages. Please use {{DEFAULTSORT:Sortkey}} rather than {{DEFAULTSORT|Sortkey}}, with a colon (":"), not a pipe symbol ("|"). This uses the magic word directly instead of using the template to call the magic word.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
11

no description

Unknownoptional



Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:DEFAULTSORT&oldid=947637803"

Categories: 
Wikipedia transclusionless templates
Sorting templates
Wikipedia magic word templates
Templates with no visible output
Hidden categories: 
Wikipedia template-protected templates
Templates using TemplateData
Templates that add a tracking category
 



This page was last edited on 27 March 2020, at 15:25 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki