Forum:MediaWiki Formatting (old post from 2007)

TOC
Is there a way to specify the level(s) of TOC that get displayed? For instance is there some way to specify that only the top two levels of the Table of Contents are shown? --RJ 18:54, 22 September 2006 (UTC)


 * That is somewhat easy to do. Add this to your local MediaWiki:Common.css:

.toc5 li.toclevel-6 {display:none} .toc4 li.toclevel-6, .toc4 li.toclevel-5 {display:none} .toc3 li.toclevel-6, .toc3 li.toclevel-5, .toc3 li.toclevel-4 {display:none} .toc2 li.toclevel-6, .toc2 li.toclevel-5, .toc2 li.toclevel-4, .toc2 li.toclevel-3 {display:none} .toc1 li.toclevel-6, .toc1 li.toclevel-5, .toc1 li.toclevel-4, .toc1 li.toclevel-3, .toc1 li.toclevel-2 {display:none}


 * And then you can create up to 5 templates like with contents:


 * and then   etc. Or you can just use the div manually. See an example here. --Splarka (talk) 04:42, 23 September 2006 (UTC)


 * Thanks, Splarka! Almost everything's happy after you know how to do it.  Thanks for making this easy.  --RJ 23:28, 24 September 2006 (UTC)