Module:Defaultsort builder/doc
From Ross Surname Project
More actions
This is the documentation page for Module:Defaultsort builder
| This is a documentation subpage for Module:Defaultsort builder. It contains usage information, categories and other content that is not part of the original module page. |
This module generates a properly formatted and standardized `DEFAULTSORT` value for use in MediaWiki pages.
It constructs a default sort key based on:
|given_name=|middle_name=|surname=|title_ordinal=|title_role=|title_object=
Features
- Standardizes `surname` using {{Surname sort standardization switch}}
- Standardizes `title_ordinal` using {{Ordinal numbers switch}}
- Excludes `title_role` if it is "laird"
- Adds commas and spaces only where appropriate
- Trims all input fields
Usage
Use in a template with `#invoke` like this:
{{#invoke:Defaultsort builder|buildDefaultSort
|given_name=John
|middle_name=Alexander
|surname=MacLeod
|title_ordinal=5th
|title_role=Chief
|title_object=Clan MacLeod
}}Example Output
{{Surname sort standardization switch|MacLeod}}, John Alexander, Clan MacLeod Chief {{Ordinal numbers switch|5th}}→ Would expand to:
MacLeod, John Alexander, Clan MacLeod Chief 5
See Also
Acknowledgements
This module includes code generated by ChatGPT.