Jump to content

Template:Automatic category TOC/core: Difference between revisions

From cernipedia
m BrownHairedGirl moved page Template:Auto category TOC/core to Template:CatAutoTOC/core over redirect: revert undiscussed WP:BOLD move. The brief name is easier to use, and distinguishes this meta-template from the templates which do the actual work of generating a TOC. Feel free to open a WP:Requested moves discussion
 
(5 intermediate revisions by 5 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<!--
            -->|pagecount={{{pagecount}}}<!--
        -->}}<!--
        -->[[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 CatAutoTOC]]
</noinclude>
</noinclude>

Latest revision as of 13:25, 19 November 2026