Difference between revisions of "Template:CatAutoTOC/core"
Jump to navigation
Jump to search
(Created page with "<includeonly><!-- # TOC, depending on category size # <= 100 pages → no TOC # 101–1200 pages → {{Category TOC}} # > 1200 pages → {{Large category TOC}} -->...") |
|||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
+ | # Using a sub-template, so that we never have have more than one call to the [[WP:EXPENSIVE]] function {{PAGESINCATEGORY}} | ||
+ | # | ||
# TOC, depending on category size | # TOC, depending on category size | ||
# <= 100 pages → no TOC | # <= 100 pages → no TOC | ||
# 101–1200 pages → {{Category TOC}} | # 101–1200 pages → {{Category TOC}} | ||
# > 1200 pages → {{Large category TOC}} | # > 1200 pages → {{Large category TOC}} | ||
− | + | ||
− | + | ########################################################################### | |
− | + | # NOTE: The sort key {{PAGENAME}} is used on all the tracking categories # | |
− | + | # to override any {{DEFAULTSORT}} used in the category # | |
− | + | ########################################################################### | |
− | + | ||
− | + | -->{{#ifexpr: {{{pagecount}}} > 1200 <!-- | |
− | |||
− | |||
− | |||
− | |||
− | |||
-->|<!-- | -->|<!-- | ||
− | + | # > 1200, so large TOC | |
− | + | -->{{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 <!-- |
− | {{Documentation}} | + | -->|[[Category:CatAutoTOC on pages where PAGESINCATEGORY returns zero|{{PAGENAME}}]]<!-- |
+ | -->}}<!-- | ||
+ | --></includeonly><noinclude> | ||
+ | {{Documentation|Template:{{ROOTPAGENAME}}/doc}} | ||
[[Category:Wikipedia CatAutoTOC]] | [[Category:Wikipedia CatAutoTOC]] | ||
</noinclude> | </noinclude> |