Difference between revisions of "Template:Alphanumeric TOC/doc"
(→Usage: add important param) |
Dmarcadmin (talk | contribs) m (27 revisions imported) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | ||
− | {{tl|Alphanumeric TOC}} is a customizable substitute for the (formerly) growing zoo of variants of {{tl|Compact | + | {{tl|Alphanumeric TOC}} is a customizable substitute for the (formerly) growing zoo of variants of {{tl|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 == | == Usage == | ||
− | |||
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 <code>|top=yes</code> to the bottom template to quickly get back to the top). | 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 <code>|top=yes</code> to the bottom template to quickly get back to the top). | ||
Line 20: | Line 19: | ||
</pre> | </pre> | ||
− | == | + | == Options == |
− | |||
=== Alignment === | === Alignment === | ||
− | |||
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 <code>align</code> with a value of 'center': | 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 <code>align</code> with a value of 'center': | ||
Line 32: | Line 29: | ||
{{alphanumeric TOC|align=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 [[ | + | 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]]. |
=== Prefixing or suffixing links or link descriptions === | === Prefixing or suffixing links or link descriptions === | ||
− | |||
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 <code>prefixLink</code> and <code>prefixDesc</code>; the former adds the prefix to the actual link, and the latter adds the prefix to the text displayed on the page. The <code>suffixLink</code> and <code>suffixDesc</code> parameters work the same way. Examples: | 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 <code>prefixLink</code> and <code>prefixDesc</code>; the former adds the prefix to the actual link, and the latter adds the prefix to the text displayed on the page. The <code>suffixLink</code> and <code>suffixDesc</code> parameters work the same way. Examples: | ||
Line 63: | Line 59: | ||
=== Standard and custom sections === | === Standard and custom sections === | ||
− | |||
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: | 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: | ||
Line 88: | Line 83: | ||
<pre> | <pre> | ||
− | {{alphanumeric TOC|align | + | {{alphanumeric TOC| style="text-align:center;" |g=|seealso=yes|externallinks=yes}} |
</pre> | </pre> | ||
− | {{alphanumeric TOC|align | + | {{alphanumeric TOC| style="text-align:center;" |g=|seealso=yes|externallinks=yes}} |
=== Optional user defined section links === | === Optional user defined section links === | ||
− | |||
Optional section links may be defined using the parameters <code>|sec1=</code>, <code>|sec2=</code>, <code>|sec3=</code>, <code>|sec4=</code>, and <code>|sec5=</code>, as follows: | Optional section links may be defined using the parameters <code>|sec1=</code>, <code>|sec2=</code>, <code>|sec3=</code>, <code>|sec4=</code>, and <code>|sec5=</code>, as follows: | ||
Line 105: | Line 99: | ||
<includeonly> | <includeonly> | ||
<!-- ADD CATEGORIES BELOW THIS LINE --> | <!-- ADD CATEGORIES BELOW THIS LINE --> | ||
− | [[Category:Wikipedia table of contents templates | + | [[Category:Wikipedia table of contents templates]] |
<!-- ADD INTERWIKIS BELOW THIS LINE --> | <!-- ADD INTERWIKIS BELOW THIS LINE --> | ||
− | |||
− | |||
− | |||
[[ca:Plantilla:Índex i taula de contingut opcional]] | [[ca:Plantilla:Índex i taula de contingut opcional]] | ||
[[ka:თარგი:საძიებელი]] | [[ka:თარგი:საძიებელი]] | ||
</includeonly> | </includeonly> |
Latest revision as of 16:47, 17 July 2015
{{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
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
Alignment
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.
Prefixing or suffixing links or link descriptions
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}}
Contents
{{alphanumeric TOC|prefixDesc=+}}
{{alphanumeric TOC|suffixDesc=+}}
Standard and custom sections
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}}
Optional user defined section links
Optional section links may be defined using the parameters |sec1=
, |sec2=
, |sec3=
, |sec4=
, and |sec5=
, as follows:
{{alphanumeric TOC|numbers=yes|seealso=yes|externallinks=yes|sec1=Added section|sec2=Plus one}}
Contents