Jump to content

Template:Alphanumeric TOC/doc

From Wikipedia, the free encyclopedia

{{Alphanumeric TOC}} is a customizable substitute for the (formerly) growing zoo of variants of {{Compact TOC}}. Rather than have dozens of stylistic varieties, it is preferable to have a single template which can be adjusted to fit the editor's wishes.

Usage

[edit]

Insert the following at the point in the article where you want the TOC to appear: If using with a list, many editors have found it helpful to insert a TOC at both the beginning and end of the list (remember to add |top=yes to the bottom template to quickly get back to the top).

{{alphanumeric TOC}}

Whenever multiple TOCs will be used on a page, and this template will not be the primary one at the top of the page, add |primary=false (this prevents multiple TOCs from showing up in each other's listings):

{{alphanumeric TOC
|primary=false
}}

Options

[edit]

Alignment

[edit]

The natural state of the TOC is to appear along the left side of the page without any alignment. To align to the center of the page, add the parameter align with a value of 'center':

{{alphanumeric TOC|align=center}}

The TOC may also be aligned to the right or the left, causing the article text to wrap around it, but floating the TOC is generally discouraged. Guidelines may be found at Help:Section#Floating the TOC.

[edit]

The template includes the ability to add a prefix to the link with or without displaying it in the TOC. This can also be accomplished with this template by using the parameters prefixLink and prefixDesc; the former adds the prefix to the actual link, and the latter adds the prefix to the text displayed on the page. The suffixLink and suffixDesc parameters work the same way. Examples:

{{alphanumeric TOC|prefixLink=1.}}
{{alphanumeric TOC|prefixLink=hidden|prefixDesc=visible}}
{{alphanumeric TOC|prefixDesc=+}}
{{alphanumeric TOC|suffixDesc=+}}

Standard and custom sections

[edit]

One of the reasons for having so many different versions of CompactTOC has been that some articles do not have a 'References' section, or the TOC is being used for a list contained within a larger article. This template solves the problem by providing a parameter for each link to be shown. They are as follows:

|numbers=yes
shows the numbers link
|a=, |b=, etc.
shows the link for that letter; alternatively it can be used to create unlinked letters (see example below)
|top=yes
shows the link to the 'Top of Page'
|seealso=yes
shows the link to the 'See also' section
|references=yes
shows the link to the 'References' section
|externallinks=yes
shows the link to the 'External links' section

Some examples:

{{alphanumeric TOC|numbers=yes|i=|n=|x=|z=|references=yes}}
{{alphanumeric TOC|numbers=yes|i=I|j=J|v=V|x=X|top=yes}}
{{alphanumeric TOC| style="text-align:center;" |g=|seealso=yes|externallinks=yes}}
[edit]

Optional section links may be defined using the parameters |sec1=, |sec2=, |sec3=, |sec4=, |sec5=, and |sec6=, as follows:

{{alphanumeric TOC|numbers=yes|seealso=yes|externallinks=yes|sec1=Added section|sec2=Plus one}}