Template:CatAutoTOC: Difference between revisions

From WikiMD's Wellness Encyclopedia

No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly>
  # TOC, depending on category size
{{#ifeq: {{PAGESINCATEGORY:{{FULLPAGENAME}}|pages}} | 0 | <!--
  # <= 100 pages → no TOC
  No pages in category, no TOC needed.
  # 101–1200 pages → {{Category TOC}}
--> | {{#switch: {{PAGESINCATEGORY:{{FULLPAGENAME}}|pages}}
  # > 1200 pages → {{Large category TOC}}
  | 1 | 100 = <!--
-->{{Category other|<!--
      No TOC for categories with 100 or fewer pages.
        #################################################################################
  -->
        #### This is a category page, so generate a TOC if needed.                   ####
  | 101 | 1200 = {{Category TOC}} <!--
        ####                                                                        ####
      Use a smaller TOC for categories with 101–1200 pages.
        #### Use a sub-template [[Template:CatAutoTOC/core]], so that we never have  ####
  -->
        #### more than one call to the [[WP:EXPENSIVE]] function {{PAGESINCATEGORY}} ####
  | #default = {{Large category TOC}} <!--
        #################################################################################
      Use a large TOC for categories with more than 1200 pages.
    -->{{CatAutoTOC/core<!--
  -->
        -->|pagecount={{PAGESINCATEGORY:{{#invoke:HTMLDecode | HTMLDecode | text={{PAGENAME}} }}|R}}<!--
}}}}
        -->|align    = {{{align|}}}<!--
</includeonly><noinclude>
        -->|top      = {{{top|}}}<!--
        -->|numerals  = {{{numerals|}}}<!--
        -->|uppercase = {{{uppercase|}}}<!--
        -->|lowercase = {{{lowercase|}}}<!--  
    -->}}<!--
-->}}<!--
-->{{Template other<!--
    -->|<!--
        #################################################################################
        #### This page is a template, so categorise it                              ####
        #### in [[Category:Templates using CatAutoTOC]] ...                          ####
        ####                                                                        ####
        #### ... 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 CatAutoTOC]]<!--
    -->}}<!--
-->}}</includeonly><noinclude>
{{Documentation}}
{{Documentation}}
[[Category:Wikimd CatAutoTOC]]
[[Category:Category TOC templates]]
[[Category:WikiMD templates]]
</noinclude>
</noinclude>

Latest revision as of 02:46, 22 December 2024