Jump to content

Template:Automatic category TOC: Difference between revisions

From cernipedia
tweak
m 37 revisions imported from wikipedia:Template:Automatic_category_TOC
 
(34 intermediate revisions by 11 users not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
   # TOC, depending on category size
   # TOC, depending on category size
   # < 100 pages = no TOC
   # <= 100 pages → no TOC
   # 100–1200 pages = {{Category TOC}}
   # 101–1200 pages → {{Category TOC}}
   # > 1200 pages = {{Large category TOC}}
   # > 1200 pages → {{Large category TOC}}
-->{{#ifexpr: {{PAGESINCATEGORY|{{PAGENAME}}|R}} > 1200 <!--
-->{{Category other|<!--
      -->|<!--
#######################################################################
            # > 1200, so large TOC
#### This is a category page, so generate a TOC if needed.        ####
          -->{{Large category TOC}}<!--
####                                                              ####
          -->[[Category:CatAutoToc generates Large category TOC]]<!--
#### Use a sub-template [[Template:Automatic category TOC/core]],  ####
      -->|<!--
#### so that we never have more than one call to the              ####
            # < 1200, so check again
#### [[WP:EXPENSIVE]] function {{PAGESINCATEGORY}}                ####
          -->{{#ifexpr: {{PAGESINCATEGORY|{{PAGENAME}}|R}} > 100<!--
#######################################################################
              -->|<!--
    -->{{Automatic category TOC/core<!--
                    # > 100, so std TOC
        -->|pagecount={{PAGESINCATEGORY:{{#invoke:HTMLDecode | HTMLDecode | text={{PAGENAME}} }}|R}}<!--
                  -->{{Category TOC}}<!--
        -->|align    = {{{align|}}}<!--
                  -->[[Category:CatAutoToc generates standard Category TOC]]<!--
        -->|top      = {{{top|}}}<!--
               -->|<!--
        -->|numerals  = {{{numerals|}}}<!--
                    # < 100, so no TOC
        -->|uppercase = {{{uppercase|}}}<!--
                  -->[[Category:CatAutoToc generates no TOC]]<!--
        -->|lowercase = {{{lowercase|}}}<!--
          -->}}<!--
    -->}}<!--
-->}}<!--
-->{{Template other<!--
    -->|<!--
#######################################################################
#### This page is a template, so categorise it                    ####
#### in [[Category:Templates using Automatic category TOC]] ...    ####
####                                                              ####
#### ... unless it is a /doc, /testcases or /sandbox              ####
####                                                              ####
#### There is no point categorising every sub-page of the          ####
#### same template                                                ####
#######################################################################
        -->{{#if: {{Str endswith|{{PAGENAME}}|/doc}}{{Str endswith|{{PAGENAME}}|/testcases}}{{Str endswith|{{PAGENAME}}|/sandbox}}<!--
        -->|<!--
               ### Don't categorise /doc, /testcases or /sandbox pages
        -->|<!--
              ### Not a /doc, /testcases or /sandbox page, so categorise it
            -->[[Category:Templates using Automatic category TOC]]<!--
    -->}}<!--
-->}}</includeonly><noinclude>
-->}}</includeonly><noinclude>
{{Documentation}}
{{Documentation}}
[[Category:Wikipedia Automatic category TOC]]
</noinclude>
</noinclude>

Latest revision as of 13:13, 19 November 2026