Difference between revisions of "Template:Horizontal TOC"
imported>Frietjes (optional links) |
imported>Frietjes (fix) |
||
| Line 3: | Line 3: | ||
}}<templatestyles src="Horizontal TOC/styles.css" />{{#if: {{{noparens|{{{no_parenthesis|}}}}}} | }}<templatestyles src="Horizontal TOC/styles.css" />{{#if: {{{noparens|{{{no_parenthesis|}}}}}} | ||
|<templatestyles src="Horizontal TOC/horizontal-toc-no-parentheses.css" /> | |<templatestyles src="Horizontal TOC/horizontal-toc-no-parentheses.css" /> | ||
| − | }}<div class="{{#if:{{{noparens|{{{no_parenthesis|}}}}}}|horizontal-toc-no-parens hlist|hlist}} horizontal-toc {{#if:{{{align|}}}|horizontal-toc-align-{{lc:{{{align|}}}}}}} {{#if:{{{clear|}}}|horizontal-toc-align-{{lc:{{{clear}}}}}}} {{#if:{{{limit|}}}|toclimit-{{{limit}}}}}">{{#if:{{{links|}}}|{{{links}}}|__TOC__}}</div><noinclude> | + | }}<div class="{{#if:{{{noparens|{{{no_parenthesis|}}}}}}|horizontal-toc-no-parens hlist|hlist}} horizontal-toc {{#if:{{{align|}}}|horizontal-toc-align-{{lc:{{{align|}}}}}}} {{#if:{{{clear|}}}|horizontal-toc-align-{{lc:{{{clear}}}}}}} {{#if:{{{limit|}}}|toclimit-{{{limit}}}}}">{{#if:{{{links|}}}|{{TOC top|align={{{align|none}}}|title={{{title|{{MediaWiki:Toc}} }}}}} |
| + | {{{links}}} | ||
| + | {{TOC bottom}}|__TOC__}}</div><noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> | ||
Revision as of 16:34, 17 July 2019
Contents
Script error: No such module "Uses TemplateStyles".
This template lays out the table of contents in a horizontal list rather than a vertical one.
Usage
{{horizontal TOC}}
There is no need to specify __NOTOC__: this template handles that automatically.
To hide the generated heading numbers, use:
{{horizontal TOC|nonum=yes}}
To suppress the parentheses around subsection lists, use:
{{horizontal TOC|noparens=yes}}
To limit the depth of the generated headings to the first headings only, use:
{{horizontal TOC|limit=2}}
To float the table of contents to the center of the page, use:
{{horizontal TOC|align=center}}
For country and state lists with flag icons, see these examples: Legality of cannabis by country. And: Legality of cannabis by U.S. jurisdiction.
See also
- Help:TOC
- {{Compact ToC}}
- {{List TOC Letters}}
This template lays out the table of contents in a horizontal list rather than a vertical one.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| No numbers | nonum | Hide the generated heading numbers
| String | optional |
| Limit | limit | Limits the depth of subheadings shown. For instance using limit=4 will hide the fourth level and deeper subheadings in the hierarchy. And limit=2 will hide all subheadings leaving only the main headings. This works by hiding the lower levels with CSS | Number | optional |
| No parenthesis | no_parenthesis | Separates entries by bullets, regardless of sub-sections.
| String | optional |
| Align | align | Which side of the page to align the ToC to. Allowed values are left, right, center
| String | optional |
| Clear | clear | Align underneath floating images and tables or not. Allowed values are left, right, both, none
| String | optional |
| Links | links | Specify a list of links for the table of contents instead of the section links automatically generated by the TOC magic word
| String | optional |
| The above documentation is transcluded from Template:Horizontal TOC/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |