Jump to content

Template:Automatic category TOC/core: Difference between revisions

From cernipedia
update after moves, and remove excessive whitespace
Line 1: Line 1:
<includeonly><!--
{{#ifexpr:{{{pagecount|0}}} > 1200
  # Using a sub-template, so that we never have have more than one call to the [[WP:EXPENSIVE]] function {{PAGESINCATEGORY}}
|{{Large category TOC
  #
  |CatAutoTOC = yes
  # TOC, depending on category size
  |pagecount = {{{pagecount}}}
  # <= 100 pages → no TOC
}}[[Category:Automatic category TOC generates Large category TOC]]
  # 101–1200 pages → {{Category TOC}}
|{{#ifexpr:{{{pagecount|0}}} > 100
  # > 1200 pages → {{Large category TOC}}
  |{{Category TOC
 
  |pagecount={{{pagecount}}}
###########################################################################
  |CatAutoTOC=yes
# NOTE: The sort key {{PAGENAME}} is used on all the tracking categories  #
  |align = {{#if:{{{align|}}}|{{{align}}}|left}}
#      to override any {{DEFAULTSORT}} used in the category              #
  |top = {{#if:{{{top|}}}|{{{top}}}|yes}}
###########################################################################
  |numerals = {{#if:{{{numerals|}}}|{{{numerals}}}|group}}
 
  |uppercase = {{#if:{{{uppercase|}}}|{{{uppercase}}}|yes}}
-->{{#ifexpr: {{{pagecount}}} > 1200 <!--
  |lowercase = {{#if:{{{lowercase|}}}|{{{lowercase}}}|no}}
    -->|<!--
  }}[[Category:Automatic category TOC generates standard Category TOC]]
          # > 1200, so large TOC
  |[[Category:Automatic category TOC generates no TOC]]
        -->{{Large category TOC<!--
}}
            -->|CatAutoTOC=yes<!--
}}{{#ifeq:{{{pagecount}}}|0
            -->|pagecount={{{pagecount}}}<!--
|[[Category:Automatic category TOC on pages where PAGESINCATEGORY returns zero]]
        -->}}<!--
}}{{clear}}<noinclude>
        -->[[Category:CatAutoTOC generates Large category TOC|{{PAGENAME}}]]<!--
    -->|<!--
          # < 1200, so check again
        -->{{#ifexpr: {{{pagecount}}} > 100<!--
            -->|<!--
                # > 100, so std TOC
                -->{{Category TOC<!--
                    -->|pagecount={{{pagecount}}}<!--
                    -->|CatAutoTOC=yes<!--
                    -->|align     = {{#if: {{{align|}}} | {{{align}}} |left}}<!--
                    -->|top       = {{#if: {{{top|}}} | {{{top}}} |yes}}<!--
                    -->|numerals = {{#if: {{{numerals|}}} | {{{numerals}}} |group}}<!--
                    -->|uppercase = {{#if: {{{uppercase|}}} | {{{uppercase}}} |yes}}<!--
                    -->|lowercase = {{#if: {{{lowercase|}}} | {{{lowercase}}} |no}}<!--
                -->}}<!--
                -->[[Category:CatAutoTOC generates standard Category TOC|{{PAGENAME}}]]<!--
            -->|<!--
                # <= 100, so no TOC
                -->[[Category:CatAutoTOC generates no TOC|{{PAGENAME}}]]<!--
        -->}}<!--
-->}}<!--
-->{{#ifeq: {{{pagecount}}} | 0 <!--
    -->|[[Category:CatAutoTOC on pages where PAGESINCATEGORY returns zero|{{PAGENAME}}]]<!--
-->}}<!--
-->{{clear}}</includeonly><noinclude>
{{Documentation|Template:{{ROOTPAGENAME}}/doc}}
{{Documentation|Template:{{ROOTPAGENAME}}/doc}}
[[Category:Wikipedia Automatic category TOC]]
[[Category:Wikipedia Automatic category TOC]]
</noinclude>
</noinclude>

Revision as of 08:28, 10 May 2024