<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.rosssurnameproject.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3ADefaultsort_builder%2Fdoc</id>
	<title>Template:Defaultsort builder/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.rosssurnameproject.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3ADefaultsort_builder%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.rosssurnameproject.net/wiki/index.php?title=Template:Defaultsort_builder/doc&amp;action=history"/>
	<updated>2026-10-21T18:17:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://www.rosssurnameproject.net/wiki/index.php?title=Template:Defaultsort_builder/doc&amp;diff=4406&amp;oldid=prev</id>
		<title>Redheadkelly at 03:26, 4 October 2025</title>
		<link rel="alternate" type="text/html" href="https://www.rosssurnameproject.net/wiki/index.php?title=Template:Defaultsort_builder/doc&amp;diff=4406&amp;oldid=prev"/>
		<updated>2025-10-04T03:26:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{documentation subpage}}&lt;br /&gt;
{{Lua|Module:Defaultsort builder}}&lt;br /&gt;
This template is called by infoboxes, such as {{tl|Infobox Ross ancestor}}, to generate a properly formatted and standardized `DEFAULTSORT` value for use in MediaWiki pages.&lt;br /&gt;
&lt;br /&gt;
It constructs a default sort key based on:&lt;br /&gt;
&lt;br /&gt;
* {{para|given_name}}&lt;br /&gt;
* {{para|middle_name}}&lt;br /&gt;
* {{para|surname}}&lt;br /&gt;
* {{para|title_ordinal}}&lt;br /&gt;
* {{para|title_role}}&lt;br /&gt;
* {{para|title_object}}&lt;br /&gt;
* {{para|birth}}&lt;br /&gt;
* {{para|death}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
* Standardizes `surname` using {{tl|Surname sort standardization switch}}&lt;br /&gt;
* Standardizes `title_ordinal` using {{tl|Ordinal numbers switch}}&lt;br /&gt;
* Excludes `title_role` if it is &amp;quot;laird&amp;quot;&lt;br /&gt;
* Adds commas and spaces only where appropriate&lt;br /&gt;
* Trims all input fields&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Use in a template with `#invoke` like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{Defaultsort builder&lt;br /&gt;
 |given_name=John&lt;br /&gt;
 |middle_name=Alexander&lt;br /&gt;
 |surname=MacLeod&lt;br /&gt;
 |title_ordinal=5th&lt;br /&gt;
 |title_role=Chief&lt;br /&gt;
 |title_object=Clan MacLeod&lt;br /&gt;
 |birth=1543&lt;br /&gt;
 |death=1616&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example Output ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;wikitext&amp;quot;&amp;gt;&lt;br /&gt;
{{Surname sort standardization switch|MacLeod}}, John Alexander, Clan MacLeod Chief {{Ordinal numbers switch|5th}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Would expand to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;MacLeod, John Alexander, Clan MacLeod Chief 5 1543–1616&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[Template:DEFAULTSORT]]&lt;br /&gt;
* [[Template:Surname sort standardization switch]]&lt;br /&gt;
* [[Template:Ordinal numbers switch]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories go here: --&amp;gt;&lt;br /&gt;
[[Category:Formatting templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Redheadkelly</name></author>
	</entry>
</feed>