差分
細
Reverted edits by 2409:4062:2E9D:D0FF:C02D:5BA1:377D:8512 (talk): page blanking (HG) (3.4.10)
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{important|Please use <code><nowiki>{{DEFAULTSORT</nowiki>{{highlight round|bc=lightgreen|''':'''}}<nowiki>Sortkey}}</nowiki></code>, rather than <code><nowiki>{{DEFAULTSORT</nowiki>{{highlight round|bc=lightsalmon|'''|'''}}<nowiki>Sortkey}}</nowiki></code>. {{nowrap|This uses the [[m:magic word|magic word]] directly instead of using the template to call the magic word.}}}}
'''{{tlf|DEFAULTSORT:<sort key>}}''' is a [[Help:Magic words|magic word]] used to modify the sequence of pages shown on [[Help:Category|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 {{brackets|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 {{section link|Help:Category|Default sort key}}.
==Understanding DEFAULTSORT==
By default, pages listed on a category page are sorted by {{tlc|PAGENAME}}. It is possible to set a different sort key by using the {{tlc|DEFAULTSORT}} [[Help:magic words|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 {{tl|DEFAULTSORT}} to modify the default sort key, the [[Help:magic words|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:
<pre>
==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| ]]
</pre>
==Tracking category==
* {{clc|Pages which use a template in place of a magic word}}
== See also ==
* {{tl|DISPLAYTITLE}}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "{{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.",
"params": {
"1": {}
}
}
</templatedata><includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Sorting templates|DEFAULTSORT]]
[[Category:Magic word templates]]
[[Category:Templates that add a tracking category]]
[[Category:Templates with no visible output]]
}}</includeonly>
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{important|Please use <code><nowiki>{{DEFAULTSORT</nowiki>{{highlight round|bc=lightgreen|''':'''}}<nowiki>Sortkey}}</nowiki></code>, rather than <code><nowiki>{{DEFAULTSORT</nowiki>{{highlight round|bc=lightsalmon|'''|'''}}<nowiki>Sortkey}}</nowiki></code>. {{nowrap|This uses the [[m:magic word|magic word]] directly instead of using the template to call the magic word.}}}}
'''{{tlf|DEFAULTSORT:<sort key>}}''' is a [[Help:Magic words|magic word]] used to modify the sequence of pages shown on [[Help:Category|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 {{brackets|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 {{section link|Help:Category|Default sort key}}.
==Understanding DEFAULTSORT==
By default, pages listed on a category page are sorted by {{tlc|PAGENAME}}. It is possible to set a different sort key by using the {{tlc|DEFAULTSORT}} [[Help:magic words|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 {{tl|DEFAULTSORT}} to modify the default sort key, the [[Help:magic words|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:
<pre>
==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| ]]
</pre>
==Tracking category==
* {{clc|Pages which use a template in place of a magic word}}
== See also ==
* {{tl|DISPLAYTITLE}}
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"description": "{{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.",
"params": {
"1": {}
}
}
</templatedata><includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Sorting templates|DEFAULTSORT]]
[[Category:Magic word templates]]
[[Category:Templates that add a tracking category]]
[[Category:Templates with no visible output]]
}}</includeonly>