Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sort title/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{High-use}} {{Lua|Module:Arguments|Module:String}} '''Module:Sort title''' is used to create [[WP:SORTKEY|sortkeys]] for pages. == What it does == The module preforms the following checks: * If the first word of the title is an [[Article (grammar)|article]], it moves it to the end of the title. For example: <code>The Avengers</code> will have a sortkey of <code>Avengers, The</code>. * If the title is disambiguated and the first word of the disambiguation is an [[Article (grammar)|article]], it moves it to the end of the disambiguation. For example: <code>Pilot (The Flash)</code> will have a sortkey of <code>Pilot (Flash, The)</code>. * If the title is disambiguated and the first word of the title and the disambiguation is an [[Article (grammar)|article]], both of the above changes will occur. For example: <code>The End (A Series of Unfortunate Events)</code> will have a sortkey of <code>End, The (Series of Unfortunate Events, A)</code>. * If the title is a number which is separated by a commas, it removes the commas. For example: <code>4,722 Hours</code> will have a sortkey of <code>4722 Hours</code>. == Usage == From template: * {{Mlx|{{BASEPAGENAME}}|getSortKey}} * {{Mlx|{{BASEPAGENAME}}|getDefaultSort}} From module: <syntaxhighlight lang="lua">local sortkeyModule = require('Module:Sort title') local sortkey = sortkeyModule._getSortKey() </source > == Function list == {| class="wikitable" |- ! scope="col" | Function ! scope="col" | Explanation |- ! scope="row" | <code>getSortKey</code> | Returns a sortkey |- ! scope="row" | <code>getDefaultSort</code> | Returns a [[WP:DEFAULTSORT|DEFAULTSORT]] string |} <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:Wikipedia modules]] }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:High-use
(
edit
)
Template:Lua
(
edit
)
Template:Mlx
(
edit
)