<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dwarffortresswiki.org/index.php?action=history&amp;feed=atom&amp;title=Template%3AListprefstring</id>
	<title>Template:Listprefstring - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dwarffortresswiki.org/index.php?action=history&amp;feed=atom&amp;title=Template%3AListprefstring"/>
	<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Template:Listprefstring&amp;action=history"/>
	<updated>2026-08-01T14:26:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.11</generator>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Template:Listprefstring&amp;diff=279735&amp;oldid=prev</id>
		<title>2kai2kai2: Correct bug in two-PREFSTRING case</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Template:Listprefstring&amp;diff=279735&amp;oldid=prev"/>
		<updated>2022-12-25T09:47:40Z</updated>

		<summary type="html">&lt;p&gt;Correct bug in two-PREFSTRING case&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:47, 25 December 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot; &gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--&amp;gt;{{#switch:{{#strlen:{{#df_foreachtag:{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|p}}}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;--&amp;gt;{{#switch:{{#strlen:{{#df_foreachtag:{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|p}}}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|1=''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|0}}''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|1=''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|0}}''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|2=''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|0}}'' and ''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;0&lt;/del&gt;}}''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|2=''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|0}}'' and ''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;1&lt;/ins&gt;}}''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|#default=&amp;lt;!--&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|#default=&amp;lt;!--&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// For a list, it's more complicated. First, LISTPREFSTRING_LISTSTR is generated, which looks like ONE, TWO, THREE but doesn't have an 'and' in it.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;// For a list, it's more complicated. First, LISTPREFSTRING_LISTSTR is generated, which looks like ONE, TWO, THREE but doesn't have an 'and' in it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_db:diff::1.12:old-279729:rev-279735 --&gt;
&lt;/table&gt;</summary>
		<author><name>2kai2kai2</name></author>
	</entry>
	<entry>
		<id>https://dwarffortresswiki.org/index.php?title=Template:Listprefstring&amp;diff=279729&amp;oldid=prev</id>
		<title>2kai2kai2: Created page with &quot;&lt;includeonly&gt;&lt;!--  // This first part locates the content of the raw file: --&gt;{{#vardefine:LISTPREFSTRING_RAWTEXT|{{#if:{{{1|}}}|{{#ifexist:{{{1|}}}|{{:{{{1|}}}}}|{{{1|}}}}}|{...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dwarffortresswiki.org/index.php?title=Template:Listprefstring&amp;diff=279729&amp;oldid=prev"/>
		<updated>2022-12-25T09:24:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;includeonly&amp;gt;&amp;lt;!--  // This first part locates the content of the raw file: --&amp;gt;{{#vardefine:LISTPREFSTRING_RAWTEXT|{{#if:{{{1|}}}|{{#ifexist:{{{1|}}}|{{:{{{1|}}}}}|{{{1|}}}}}|{...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;&amp;lt;!-- &lt;br /&gt;
// This first part locates the content of the raw file:&lt;br /&gt;
--&amp;gt;{{#vardefine:LISTPREFSTRING_RAWTEXT|{{#if:{{{1|}}}|{{#ifexist:{{{1|}}}|{{:{{{1|}}}}}|{{{1|}}}}}|{{:{{FULLPAGENAME}}/raw}}}}}}&amp;lt;!--&lt;br /&gt;
// Then check that there is a PREFSTRING tag (also that LISTPREFSTRING_RAWTEXT is not empty):&lt;br /&gt;
--&amp;gt;{{#if: {{tag|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING}}|&amp;lt;!--&lt;br /&gt;
// Write the initial part&lt;br /&gt;
--&amp;gt;Some dwarves [[Preferences|like]] {{tagentry|{{#var:LISTPREFSTRING_RAWTEXT}}|NAME|2|notfound={{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|NAME_PLURAL}}}} for their &amp;lt;!--&lt;br /&gt;
// Now we need a list. This finds if the number of PREFSTRING tags is 1, 2, or more (for list grammar) then does different things for each:&lt;br /&gt;
--&amp;gt;{{#switch:{{#strlen:{{#df_foreachtag:{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|p}}}}&lt;br /&gt;
|1=''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|0}}''&lt;br /&gt;
|2=''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|0}}'' and ''{{tagvalue|{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|0}}''&lt;br /&gt;
|#default=&amp;lt;!--&lt;br /&gt;
// For a list, it's more complicated. First, LISTPREFSTRING_LISTSTR is generated, which looks like ONE, TWO, THREE but doesn't have an 'and' in it.&lt;br /&gt;
--&amp;gt;{{#vardefine:LISTPREFSTRING_LISTSTR|{{#substr:{{#df_foreachtag:{{#var:LISTPREFSTRING_RAWTEXT}}|PREFSTRING|, ''\2''}}|2}}}}&amp;lt;!--&lt;br /&gt;
// Then, add the ', and' to complete the list (with Oxford comma, of course).&lt;br /&gt;
       --&amp;gt;{{#substr:{{#var:LISTPREFSTRING_LISTSTR}}|0|{{#strrpos:{{#var:LISTPREFSTRING_LISTSTR}}|,}}}}, and {{#substr:{{#var:LISTPREFSTRING_LISTSTR}}|{{#expr:1+{{#strrpos:{{#var:LISTPREFSTRING_LISTSTR}}|,}}}}}}&lt;br /&gt;
}}.}}&amp;lt;/includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;Lists all the reasons dwarves like something. For example: &lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{listprefstring|DF2014:Eagle/raw}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{listprefstring|DF2014:Eagle/raw}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{listprefstring|DF2014:Eagle/raw}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{listprefstring|DF2014:Roc/raw}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{listprefstring|DF2014:Nightwing/raw}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{listprefstring|DF2014:Nightwing/raw}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{listprefstring|{{DF2014:Nightwing/raw}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{listprefstring|{{DF2014:Nightwing/raw}}}}&lt;br /&gt;
&lt;br /&gt;
''Note that the reason for using DF2014 examples is merely that the raws for later version(s) have not been added at the time of writing''&lt;br /&gt;
&lt;br /&gt;
Argument can be any of the following:&lt;br /&gt;
* Location of the raw file. e.g. &amp;lt;code&amp;gt;DF2014:Nightwing/raw&amp;lt;/code&amp;gt;&lt;br /&gt;
* Full text of the raw file.&lt;br /&gt;
* None (Uses &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{FULLPAGENAME}}/raw&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;)&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>2kai2kai2</name></author>
	</entry>
</feed>