Template:TOClimit/doc
![]() |
This is a documentation subpage for Template:TOClimit (see that page for the template itself). It contains usage information, categories and other content that is not part of the original template page. |
This template inserts a Table of Contents which omits subheadings lower than a certain level. The table obeys the same layout rules as the __TOC__ magic word. Omitted sections still have section edit links in the article body; the main use for this template is situations where you want section edit links for ease of editing but don't want to clutter the table of contents.
Usage
{{TOClimit}}
The template defaults to including only == level 2 == and === level 3 === headers.
You can specify a different limit by adding a header level:
{{TOClimit|4}}
4 allows ==== level 4 headers ==== but omits any subheadings below that from the TOC.
The template works by hiding the lower levels with CSS. See MediaWiki:Common.css.
Conflicts
This template does not interact well with the {{TOCright}}, {{TOCleft}}, {{TOCcenter}} templates. To achieve the correct effect, use those with a limit parameter. For example, {{TOCright{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} has the effect that {{TOCright{{{2}}}{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} and {{TOClimit{{{3}}}{{{4}}}{{{5}}}{{{6}}}{{{7}}}{{{8}}}{{{9}}}{{{10}}}{{{11}}}...}} would have—if they worked together.