Export this template, then import, to install it.
Use edit summary: Copied from [[w:c:templates:Template:Toclimit]] to properly attribute this template's editors.
This template is probably not already on your wiki.
Template documentation
Note: the template above may sometimes be partially or fully invisible.

View or edit this documentation. (How does this work?)

Editors can experiment with this template's sandbox and test case pages.
This limits the level of heading displayed in the TOC. This uses __TOC__, so the TOC will appear where the heading is.
Required CSS
.toclimit-2 .toclevel-1 ol,
.toclimit-3 .toclevel-2 ol,
.toclimit-4 .toclevel-3 ol,
.toclimit-5 .toclevel-4 ol,
.toclimit-6 .toclevel-5 ol,
.toclimit-7 .toclevel-6 ol { display: none; }
toclevel-# is standard in all TOCs. toclimit-# is not; it is a div encasing the TOC when this template is used.
limit is the highest level to display. It can be either the first parameter or the
Community content is available under CC-BY-SA unless otherwise noted.