Template:TOC limit/doc
| This is a documentation subpage for Template:TOC limit It contains usage information, categories and other content that is not part of the original template page. |
| This template uses TemplateStyles: |
| This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
Dis template dey insert one Table of Contents wey remove subheadings wey pass a certain depth. Di table dey follow di same layout rules like di __TOC__ magic word. Sections wey no show still get section edit links inside di article body. Di main reason to use dis template be when you want section edit links to make editing easy but you no want complete table of contents. Before you use dis template, think about whether and why e go help readers and other editors.
How to use am
[edit source]{{TOC limit}} or {{TOC limit|3}}
By default, dis template dey include second- and third-level headings, like di ones wey show as "1" and "1.1" inside TOC. (Note: {{TOC limit|1}} no do anything because di first-level heading on a page be di page title by default.)
You fit choose another limit by adding header level:
{{TOC limit|4}}
4 go allow fourth-level headings, like "1.1.1", but any subheadings below dat no go show for di TOC.
Dis template dey work by hiding di lower levels with CSS. See Template:TOC limit/styles.css.
TOC levels compared with wikitext header levels
[edit source]Normally, heading levels for TOC match di header levels for wikitext. So == Level-2 header == normally go create first-level ("1") TOC headings, === Level-3 header === normally go create second-level ("1.1") TOC headings, and so on.
Dis matching no dey work if di page get = Level-1 headers = or if header levels skip.
For example, wikitext like dis:
== Level-2 heading (A) == === Level-3 heading (B) === == Level-2 heading (C) == ====== Level-6 heading (D) ====== = Level-1 heading (E) = == Level-2 heading (F) == === Level-3 heading (G) ===
go create TOC like dis:
Contents
|
Using {{TOC limit}} on dis page no go hide header D, because even though e be level-6 heading, e dey show as second level inside di TOC.
And e go hide header G even though e be level-3 heading just like header B, because header G dey show as third level in di TOC while header B dey show as second level.
Problems wey fit happen
[edit source]Dis template no dey work well with {{TOC right}}, {{TOC left}}, and {{TOC center}} templates.
To get di correct result, use those templates with limit parameter.
Example: {{TOC right|limit=2}} go get di same effect wey {{TOC right}} and {{TOC limit|2}} suppose get if dem fit work together.
Because of how TOC dey generate with MobileFrontend (mobile/tablet view), dis template currently no affect how mobile TOC dey display.
Dis template no dey work with di Vector 2022 skin. Check di bug report at Template:Phab for more details.
TemplateData
[edit source]E dey insert Table of Contents wey remove subheadings wey pass certain depth.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Limit | 1 limit | Maximum header depth wey go enter table of contents
| Number | suggested |
See also
[edit source]{{TOC hidden}}