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 "User:OddballJoe/VersionLoop"
Jump to navigation
Jump to search
OddballJoe (talk | contribs) |
OddballJoe (talk | contribs) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
− | -->{{#mreplace: {{#mreplace: {{#mreplace: {{{1}}}|$(ns)|}}|$(ver)| | + | -->{{#mreplace: {{#mreplace: {{#mreplace: {{{1}}}|$(ns)|}}|$(ver)|50}}|$(selected-value)|{{#ifeq: {{{selected-ver}}}|50|{{{selected-value}}}|}}}}<!-- |
− | -->{{#mreplace: {{#mreplace: {{{1}}}|$(ns)|DF2014}}|$(ver)| | + | -->{{#mreplace: {{#mreplace: {{#mreplace: {{{1}}}|$(ns)|DF2014}}|$(ver)|0.47}}|$(selected-value)|{{#ifeq: {{{selected-ver}}}|0.47|{{{selected-value}}}|}}}}<!-- |
− | -->{{#mreplace: {{#mreplace: {{{1}}}|$(ns)|v0.34}}|$(ver)| | + | -->{{#mreplace: {{#mreplace: {{#mreplace: {{{1}}}|$(ns)|v0.34}}|$(ver)|0.34}}|$(selected-value)|{{#ifeq: {{{selected-ver}}}|0.34|{{{selected-value}}}|}}}}<!-- |
− | -->{{#mreplace: {{#mreplace: {{{1}}}|$(ns)|v0.31}}|$(ver)| | + | -->{{#mreplace: {{#mreplace: {{#mreplace: {{{1}}}|$(ns)|v0.31}}|$(ver)|0.31}}|$(selected-value)|{{#ifeq: {{{selected-ver}}}|0.31|{{{selected-value}}}|}}}}<!-- |
− | -->{{#mreplace: {{#mreplace: {{{1}}}|$(ns)|40d}}|$(ver)| | + | -->{{#mreplace: {{#mreplace: {{#mreplace: {{{1}}}|$(ns)|40d}}|$(ver)|0.28}}|$(selected-value)|{{#ifeq: {{{selected-ver}}}|0.28|{{{selected-value}}}|}}}}<!-- |
− | -->{{#mreplace: {{#mreplace: {{{1}}}|$(ns)|23a}}|$(ver)| | + | -->{{#mreplace: {{#mreplace: {{#mreplace: {{{1}}}|$(ns)|23a}}|$(ver)|0.23}}|$(selected-value)|{{#ifeq: {{{selected-ver}}}|0.23|{{{selected-value}}}|}}}}<!-- |
+ | --></includeonly> | ||
<noinclude> | <noinclude> | ||
+ | This template repeats a user-provided string once for each DF version era while substituting variables. In pseudocode: | ||
− | {{User:OddballJoe/VersionLoop|$(selected-value) | + | for each DF version era: |
+ | replace $(ns) with the associated namespace, like "40d" | ||
+ | replace $(ver) with the associated version, like "0.28" | ||
+ | if the selected-ver argument was provided, and selected-ver is equal to $(ver): | ||
+ | replace $(selected-value) with the selected-value argument | ||
+ | |||
+ | For example, to list all versions and their namespaces, while highlighting v0.28 in particular, you can use | ||
+ | |||
+ | <pre><nowiki>{{User:OddballJoe/VersionLoop|Version "v$(ver)" has namespace "$(ns)" $(selected-value)<br>|selected-ver=0.28|selected-value=<--selected--}}</nowiki></pre> | ||
+ | |||
+ | {{User:OddballJoe/VersionLoop|Version "v$(ver)" has namespace "$(ns)" $(selected-value)<br>|selected-ver=0.28|selected-value=<--selected--}} | ||
</noinclude> | </noinclude> |
Latest revision as of 02:12, 4 February 2023
This template repeats a user-provided string once for each DF version era while substituting variables. In pseudocode:
for each DF version era: replace $(ns) with the associated namespace, like "40d" replace $(ver) with the associated version, like "0.28" if the selected-ver argument was provided, and selected-ver is equal to $(ver): replace $(selected-value) with the selected-value argument
For example, to list all versions and their namespaces, while highlighting v0.28 in particular, you can use
{{User:OddballJoe/VersionLoop|Version "v$(ver)" has namespace "$(ns)" $(selected-value)<br>|selected-ver=0.28|selected-value=<--selected--}}
Version "v50" has namespace ""
Version "v0.47" has namespace "DF2014"
Version "v0.34" has namespace "v0.34"
Version "v0.31" has namespace "v0.31"
Version "v0.28" has namespace "40d" <--selected--
Version "v0.23" has namespace "23a"