v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Template:CategoryVersion"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Attempt to abbreviate "other" version numbers on Category pages the same as is done on Article pages)
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<!-- DO NOT split this template into two different templates. DO NOT edit this template unless you know very well what you are doing. This template is extremely easy to break. --><noinclude>{{shortcut|template:cv}}</noinclude>
+
<noinclude>
<table id="avtable" style='text-align: center; margin: 0 auto; padding: 0.25em; border: 2px {{#switch:{{{1}}}|{{df:current}}=solid #bd8; background: #f5ffee;|#default=solid #db8; background: #fff5ee;}} max-width:27em'><tr><td style="padding: 0.3em 0.3em; width: 100%;"><div style="margin-bottom:6px;"><font style="font-size:100%"><!--- place new version links here --->{{#ifeq:{{{1}}}|DF2012|{{avcurrent|v{{current/version}}|{{{1}}}}}{{dot}}|{{#ifexist:Category:DF2012:{{{2}}}|{{avcolorlinks|:Category:DF2012:{{{2}}}|v{{current/version}}|{{{1}}}}}{{dot}}|<font style="font-size:95%">{{avbadlink|:Category:DF2012:{{{2}}}|v{{current/version}}}}</font>{{dot}}}}}} {{#ifeq:{{{1}}}|v0.31|{{avcurrent|v0.31.25|{{{1}}}}}{{dot}}|{{#ifexist:Category:v0.31:{{{2}}}|{{avcolorlinks|:Category:v0.31:{{{2}}}|v0.31.25|{{{1}}}}}{{dot}}|<font style="font-size:95%">{{avbadlink|:Category:v0.31:{{{2}}}|v0.31.25}}</font>{{dot}}}}}} {{#ifeq:{{{1}}}|40d|{{avcurrent|v0.28.181.40d|{{{1}}}}}{{dot}}|{{#ifexist:Category:40d:{{{2}}}|{{avcolorlinks|:Category:40d:{{{2}}}|v0.28.181.40d|{{{1}}}}}{{dot}}|<font style="font-size:95%">{{avbadlink|:Category:40d:{{{2}}}|v0.28.181.40d}}</font>{{dot}}}}}} {{#ifeq:{{{1}}}|23a|{{avcurrent|v0.23.130.23a|{{{1}}}}}|{{#ifexist:Category:23a:{{{2}}}|{{avcolorlinks|:Category:23a:{{{2}}}|v0.23.130.23a|{{{1}}}}}|<font style="font-size:95%">{{avbadlink|:Category:23a:{{{2}}}|v0.23.130.23a}}</font>}}}}</font></div><font style="size:75%;">{{#switch:{{{1}}}|#default=This category is about an '''older version''' of DF.|Template=This category is in the template namespace.|{{df:current}}=This category is about the current version of DF.}}</font><br><div style="float: right; font-size:75%; padding-right:2px; margin-top: -2px; margin-bottom:-7px;">{{avcolorlinks|Template:CategoryVersion|More Info|{{{1}}}}}[[Category:{{{1}}}|{{{2}}}]][[Category:{{{2}}}|*{{{2}}}]]</div></td></tr></table><noinclude>
+
<!-- DO NOT edit this template unless you know very well what you are doing. This template is extremely easy to break. -->{{shortcut|template:cv}}</noinclude><includeonly>{{#vardefine:cv-page|{{PAGENAME}}}}{{
{{docbox|Documentation|template:CategoryVersion/doc}}
+
#ifeq:{{NAMESPACE}}|Category|
{{CategoryVersion/doc}}
+
<!-- display -->
{{docbox-foot}}
+
{{#vardefine:cv-ns|{{#rsplit:{{#var:cv-page}}|:|0}}}}{{
 +
#vardefine:cv-cn|{{#rsplit:{{#var:cv-page}}|:|1}}
 +
}}{{#ifeq:{{#var:cv-cn}}|{{#var:cv-ns}}|{{#vardefine:cv-ns|parent}}}}{{
 +
version links
 +
|theme={{#switch:{{lc:{{#var:cv-ns}}}}|{{lc:{{DF:Current}}}}|parent=green|#default=orange}}
 +
|r1=
 +
[[{{#ifeq:{{#var:cv-ns}}|DF2014|*}}:Category:DF2014:{{#var:cv-cn}}|v{{current/version}}]]
 +
[[{{#ifeq:{{#var:cv-ns}}|V0.34|*}}:Category:V0.34:{{#var:cv-cn}}|v{{#ifeq:{{#var:cv-ns}}|V0.34|0.34.11|0.34}}]]
 +
[[{{#ifeq:{{#var:cv-ns}}|V0.31|*}}:Category:V0.31:{{#var:cv-cn}}|v{{#ifeq:{{#var:cv-ns}}|V0.31|0.31.25|0.31}}]]
 +
[[{{#ifeq:{{#var:cv-ns}}|40d|*}}:Category:40d:{{#var:cv-cn}}|v{{#ifeq:{{#var:cv-ns}}|40d|0.28.181.40d|0.28}}]]
 +
[[{{#ifeq:{{#var:cv-ns}}|23a|*}}:Category:23a:{{#var:cv-cn}}|v{{#ifeq:{{#var:cv-ns}}|23a|0.23.130.23a|0.23}}]]
 +
|bottom={{version links/link|:Category:{{#var:cv-cn}}|Parent}}
 +
|center={{#switch:{{lc:{{#var:cv-ns}}}}|#default=This category contains pages about an '''older version''' of DF.|parent=This is a parent category.|template=This category is in the template namespace.|{{lc:{{df:current}}}}=This category contains pages about the current version of DF.}}
 +
}}{{#ifeq:{{#var:cv-ns}}|parent||[[Category:{{#var:cv-ns}}|{{#var:cv-cn}}]]}}[[Category:{{#var:cv-cn}}|*{{version order|{{#var:cv-ns}}}}]]|<!-- errors -->
 +
<span class="error">This page is not in the Category namespace!</span>}}
 +
</includeonly><noinclude>
 +
{{documentation}}
 
[[category:Templates]]
 
[[category:Templates]]
  
 
</noinclude>
 
</noinclude>

Revision as of 02:34, 29 August 2021

Shortcut:
template:cv