https://wiki.hisgis.nl/index.php?title=Sjabloon:TOC_limit/doc&feed=atom&action=historySjabloon:TOC limit/doc - Bewerkingsoverzicht2024-03-28T22:09:16ZBewerkingsoverzicht voor deze pagina op de wikiMediaWiki 1.38.2https://wiki.hisgis.nl/index.php?title=Sjabloon:TOC_limit/doc&diff=2087&oldid=prevThomas: 1 versie geïmporteerd2019-11-05T10:47:34Z<p>1 versie geïmporteerd</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="nl">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Oudere versie</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Versie van 5 nov 2019 11:47</td>
</tr><tr><td colspan="2" class="diff-notice" lang="nl"><div class="mw-diff-empty">(geen verschil)</div>
</td></tr></table>Thomashttps://wiki.hisgis.nl/index.php?title=Sjabloon:TOC_limit/doc&diff=2086&oldid=previnterwiki>Paine Ellsworth: update /doc2019-01-05T20:51:15Z<p>update /doc</p>
<p><b>Nieuwe pagina</b></p><div>{{Documentation subpage}}<br />
{{Uses TemplateStyles|Template:TOC limit/styles.css}}<br />
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]). --><br />
{{High-use| 15719 }}<br />
This template inserts a Table of Contents which omits subheadings beyond a certain depth. The table obeys the same layout rules as the <nowiki>__TOC__</nowiki> [[WP:MAGIC|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.<br />
<br />
=== Usage ===<br />
<br />
{{tlx|TOC limit}} or {{tlx|TOC limit|3}}<br />
<br />
The template defaults to including second- and third-level headings, e.g. those numbered "1" and "1.1" in the TOC. (Note: The first-level heading on a page is, by default, the page title.)<br />
<br />
You can specify a different limit by adding a header level:<br />
<br />
{{tlx|TOC limit|4}}<br />
<br />
4 allows for fourth-level headings, e.g. "1.1.1", but omits any subheadings below that from the TOC.<br />
<br />
The template works by hiding the lower levels with CSS. See [[Template:TOC limit/styles.css]].<br />
<br />
=== TOC levels versus wikitext header levels ===<br />
The heading levels in the TOC normally correspond to the header levels in the wikitext, so a "== Level-2 header ==" will normally generate the first-level ("1") TOC headings, a "=== Level-3 header ===" will normally generate the second-level ("1.1") TOC headings, and so on. This correspondence does ''not'' hold if the page contains "= Level-1 headers =" or skips header levels. For example, wikitext like this:<br />
== Level-2 heading (A) ==<br />
=== Level-3 heading (B) ===<br />
== Level-2 heading (C) ==<br />
====== Level-6 heading (D) ======<br />
= Level-1 heading (E) =<br />
== Level-2 heading (F) ==<br />
=== Level-3 heading (G) ===<br />
will generate a TOC like this:<br />
{| class="toc"<br />
|<div style="text-align:center"><b>Contents</b></div><br />
<ul><br />
<li class="toclevel-1 tocsection-1"><span class="tocnumber">1</span> <span class="toctext">Level-2 heading (A)</span><ul><br />
<li class="toclevel-2 tocsection-2"><span class="tocnumber">1.1</span> <span class="toctext">Level-3 heading (B)</span></li><br />
</ul></li><br />
<li class="toclevel-1 tocsection-1"><span class="tocnumber">2</span> <span class="toctext">Level-2 heading (C)</span><ul><br />
<li class="toclevel-2 tocsection-2"><span class="tocnumber">2.1</span> <span class="toctext">Level-6 heading (D)</span></li><br />
</ul></li><br />
<li class="toclevel-1 tocsection-1"><span class="tocnumber">3</span> <span class="toctext">Level-1 heading (E)</span><ul><br />
<li class="toclevel-2 tocsection-2"><span class="tocnumber">3.1</span> <span class="toctext">Level-2 heading (F)</span><ul><br />
<li class="toclevel-3 tocsection-3"><span class="tocnumber">3.1.1</span> <span class="toctext">Level-3 heading (G)</span></li><br />
</ul></li><br />
</ul></li><br />
</ul><br />
|}<br />
Using <tt><nowiki>{{TOC limit}}</nowiki></tt> on this page ''would not'' hide header D, because even though it is a level-6 heading it is shown at the second level in the TOC. And it ''would'' hide header G even though it is a level-3 heading just like header B, because header G is shown at the third level in the TOC while header B is shown at the second level.<br />
<br />
=== Conflicts ===<br />
This template does not interact well with the {{tl|TOC right}}, {{tl|TOC left}}, {{tl|TOC center}} templates. To achieve the correct effect, use those with a limit parameter. For example, {{tlx|TOC&nbsp;right|2=limit=2}} has the effect that {{tlx|TOC&nbsp;right}} and {{tlx|TOC&nbsp;limit|2}} would have—if they worked together.<br />
<br />
Due to the way the TOC is generated with MobileFrontend (mobile/tablet view) this template does not currently affect how the mobile TOC is displayed.<br />
<br />
==See also==<br />
{{tl|TOC hidden}}<br />
<includeonly>{{Sandbox other||<br />
<!-- Categories go below this line, please; interwikis go to Wikidata, thank you! --><br />
[[Category:Wikipedia table of contents templates|{{PAGENAME}}]]<br />
<br />
}}</includeonly></div>interwiki>Paine Ellsworth