Template:Mod List: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
No edit summary
mNo edit summary
Line 1: Line 1:
<includeonly><tabber>
<includeonly><tabber>
|-|Alphabetical=
|-|Alphabetical=
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | <div class="dplcategory">}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | <div class="dplcategory">}}
{{#dpl:
{{#dpl:
|{{{1}}}
|{{{1}}}
Line 31: Line 31:
|format             = ,\n* [[%PAGE%|%TITLE%]] ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
|format             = ,\n* [[%PAGE%|%TITLE%]] ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
}}
}}
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | </div>}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | </div>}}
|-|Most Viewed=
|-|Most Viewed=
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | <div class="dplcategory">}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | <div class="dplcategory">}}
{{#dpl:
{{#dpl:
|{{{1}}}
|{{{1}}}
Line 65: Line 65:
|format             = ,\n# [[%PAGE%|%TITLE%]] <small>(%COUNT% views)</small> ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
|format             = ,\n# [[%PAGE%|%TITLE%]] <small>(%COUNT% views)</small> ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
}}
}}
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | </div>}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | </div>}}
|-|Recently Updated=
|-|Recently Updated=
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | <div class="dplcategory">}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | <div class="dplcategory">}}
{{#dpl:
{{#dpl:
|{{{1}}}
|{{{1}}}
Line 101: Line 101:
|format             = ,\n* [[%PAGE%|%TITLE%]] <small>(Last revision: %DATE%)</small> ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
|format             = ,\n* [[%PAGE%|%TITLE%]] <small>(Last revision: %DATE%)</small> ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
}}
}}
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | </div>}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | </div>}}
|-|Recently Added=
|-|Recently Added=
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | <div class="dplcategory">}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | <div class="dplcategory">}}
{{#dpl:
{{#dpl:
|{{{1}}}
|{{{1}}}
Line 136: Line 136:
|format             = ,\n* [[%PAGE%|%TITLE%]] <small>(Added: %DATE%)</small> ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
|format             = ,\n* [[%PAGE%|%TITLE%]] <small>(Added: %DATE%)</small> ²{#ifeq:¦²{GETSHORTDESC:%PAGE%}²¦¦ - ²{GETSHORTDESC:%PAGE%}²}²,,
}}
}}
{{#ifexpr: {{PAGESINCAT: {{PAGENAME}}}} > 100 | </div>}}
{{#ifexpr: {{PAGESINCAT: {{#replace:{{{1}}}|category        = |}}}} {{#if: {{{3}}}|- {{PAGESINCAT: {{#replace:{{{2}}}|notcategory      = |}}}}|}} {{#if: {{{4}}}|- {{PAGESINCAT: {{#replace:{{{3}}}|notcategory      = |}}}}|}} {{#if: {{{5}}}|- {{PAGESINCAT: {{#replace:{{{4}}}|notcategory      = |}}}}|}} {{#if: {{{6}}}|- {{PAGESINCAT: {{#replace:{{{5}}}|notcategory      = |}}}}|}} {{#if: {{{7}}}|- {{PAGESINCAT: {{#replace:{{{6}}}|notcategory      = |}}}}|}} {{#if: {{{8}}}|- {{PAGESINCAT: {{#replace:{{{7}}}|notcategory      = |}}}}|}} {{#if: {{{9}}}|- {{PAGESINCAT: {{#replace:{{{8}}}|notcategory      = |}}}}|}} {{#if: {{{10}}}|- {{PAGESINCAT: {{#replace:{{{9}}}|notcategory      = |}}}}|}} {{#if: {{{11}}}|- {{PAGESINCAT: {{#replace:{{{10}}}|notcategory      = |}}}}|}} > 6 | </div>}}
</tabber></includeonly><noinclude>
</tabber></includeonly><noinclude>
A very inefficient template for generating mod lists.
A very inefficient template for generating mod lists.
Line 142: Line 142:
Uses [[mediawikiwiki:Extension:TabberNeue|TabberNeue]] to make 4 tabs: Alphabetical, Most Viewed, Recently Updated, and Recently Added.
Uses [[mediawikiwiki:Extension:TabberNeue|TabberNeue]] to make 4 tabs: Alphabetical, Most Viewed, Recently Updated, and Recently Added.


It then checks if the current game has more than 100 mods (checking <code><nowiki>[[Category:Game name mods]]</nowiki></code> using <code><nowiki>{{PAGESINCAT: {{PAGENAME}}}}</nowiki></code>) and if so sets the class to dplcategory, which [[MediaWiki:Common.css]] will display as 2 columns. It checks 2 times per tab (div start and div end) for a total of 8 checks per usage of this template.
It then checks if the category has more than 6 mods (does this by taking the value of <code><nowiki>{{{1}}}</nowiki></code>, removing <code><nowiki>category        = </nowiki></code> dpl3 uses, and then checks if <code><nowiki>{{{3}}}</nowiki></code> exists to determine if categories are being excluded in <code><nowiki>{{{2}}}</nowiki></code> -'''Note: this could be wrong, a different dpl3 function could be used instead somewhere, or things could be put out of order'''- and if so subtracting the number of excluded categories from the number of included categories. This gets checked all the way to <code><nowiki>#if: {{{11}}}</nowiki></code>, or the 9 subtracted categories) and if so sets the class to dplcategory, which [[MediaWiki:Common.css]] will display as 2 columns. It checks 2 times per tab (div start and div end) for a total of 8 checks per usage of this template.


In each tab it uses [[mediawikiwiki:Extension:DynamicPageList3|DynamicPageList3]] to generate a list of mods based off category entries. DPL3 doesn't allow Magic words, so use parameters to make it easier to fill in the game page/category name. 25 parameter slots just in case a lot of categories need included/excluded. Output removes <code>Game name mods/</code> from the hyperlink text (if <code>replaceintitle</code> is correctly set), and adds <code><nowiki>{{SHORTDESC}}</nowiki></code> if it exists.
In each tab it uses [[mediawikiwiki:Extension:DynamicPageList3|DynamicPageList3]] to generate a list of mods based off category entries. DPL3 doesn't allow Magic words, so use parameters to make it easier to fill in the game page/category name. 25 parameter slots just in case a lot of categories need included/excluded. Output removes <code>Game name mods/</code> from the hyperlink text (if <code>replaceintitle</code> is correctly set), and adds <code><nowiki>{{SHORTDESC}}</nowiki></code> if it exists.

Navigation menu