Jump to content

Template:Automatic category TOC/core: Difference between revisions

From cernipedia
update thresholds
 
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<includeonly><!--
<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
  #
  |Automatic category TOC = yes
  # TOC, depending on category size
  }}
  # <= 100 pages → no TOC
  |{{#ifexpr:{{{pagecount|0}}} > 100
  # 101–1200 pages → {{Category TOC}}
  |{{Category TOC
  # > 1200 pages → {{Large category TOC}}
  |Automatic category TOC = yes
 
  |align = {{#if:{{{align|}}}|{{{align}}}|left}}
###########################################################################
  |top = {{#if:{{{top|}}}|{{{top}}}|yes}}
# NOTE: The sort key {{PAGENAME}} is used on all the tracking categories  #
  |numerals = {{#if:{{{numerals|}}}|{{{numerals}}}|group}}
  #      to override any {{DEFAULTSORT}} used in the category              #
  |uppercase = {{#if:{{{uppercase|}}}|{{{uppercase}}}|yes}}
###########################################################################
  |lowercase = {{#if:{{{lowercase|}}}|{{{lowercase}}}|no}}
 
  }}
-->{{#ifexpr: {{{pagecount}}} > 1200 <!--
  |[[Category:Automatic category TOC generates no TOC]]
    -->|<!--
  }}
          # > 1200, so large TOC
}}{{clear}}</includeonly><noinclude>
        -->{{Large category TOC|CatAutoTOC=yes}}<!--
        -->[[Category:CatAutoTOC generates Large category TOC|{{PAGENAME}}]]<!--
    -->|<!--
          # < 1200, so check again
        -->{{#ifexpr: {{{pagecount}}} > 100<!--
            -->|<!--
                # > 100, so std TOC
                -->{{Category TOC|CatAutoTOC=yes}}<!--
                -->[[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}}]]<!--
  -->}}<!--
--></includeonly><noinclude>
{{Documentation|Template:{{ROOTPAGENAME}}/doc}}
{{Documentation|Template:{{ROOTPAGENAME}}/doc}}
[[Category:Wikipedia CatAutoTOC]]
</noinclude>
</noinclude>

Latest revision as of 13:25, 19 November 2026