Template:Horizontal TOC

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Documentationview · edit · history · purge ]
This documentation is transcluded from Template:Horizontal TOC/doc.

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.

Template parameters

ParameterDescriptionDefaultStatus
nonumno numbersHide the generated heading numbersemptyoptional
limitlimitLimits 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.emptyoptional
alignalignmentWhich side of the page to align the ToC to. Allowed values are left, right, centeremptyoptional
clearclearAlign underneath floating images and tables or not. Allowed values are left, right, both, noneemptyoptional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

This template lays out the table of contents in a horizontal list rather than a vertical one.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
alignmentalign

Which side of the page to align the ToC to. Allowed values are left, right, center

Lineoptional
clearclear

Align underneath floating images and tables or not. Allowed values are left, right, both, none

Lineoptional
limitlimit

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.

Numberoptional
no numbersnonum

Hide the generated heading numbers

Lineoptional

Additional information

The template is intended to be used in the following namespaces: no namespace specified

The template is intended to be used by the following user groups: no user group specified

Relies on:
{{Nonumtoc}}

Example

{{horizontal TOC|}}

renders as:

See also

Further examples

To hide the generated heading numbers, use:

{{horizontal TOC|nonum=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}}