Πρότυπο:TOC limit
Το πρότυπο περιλαμβάνει πίνακα που παραλείπει υποενότητες πέρα από συγκεκριμένο βάθος. Ο παραγόμενος πίνακας περιεχομένων υπακούει στους ίδιους κανόνες σχεδιασμού,magic word, όπως το __TOC__ . Οι παραβλεφθείσες ενότητες διατηρούν τους συνδέσμους επεξεργασίας τους στο σώμα κειμένου.
Χρήση
[επεξεργασία κώδικα]{{TOC limit}}
The template defaults to including only the first- and second-level headings, e.g. those numbered "1" and "1.1" in the TOC.
You can specify a different limit by adding a header level:
{{TOC limit|4}}
4 allows for third-level headings, e.g. "1.1.1", but omits any subheadings below that from the TOC.
The template works by hiding the lower levels with CSS. See MediaWiki:Common.css.
A suggested alternative is {{TOC hidden}}.
Επίπεδα TOC vs επίπεδα βικικειμένου κεφαλίδων
[επεξεργασία κώδικα]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:
== 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) ===
will generate a TOC like this:
Contents
|
Using {{TOC limit}} 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.
Συγκρούσεις
[επεξεργασία κώδικα]This template does not interact well with the {{TOC right}}, {{TOC left}}, {{TOC center}} templates. To achieve the correct effect, use those with a limit parameter. For example, {{TOC right|limit=2}}
has the effect that {{TOC right}}
and {{TOC limit|2}}
would have—if they worked together.