Template:cattoc
- The following documentation is located at Template:cattoc/documentation. [edit]
- Useful links: subpage list • links • redirects • transclusions • errors (parser/module) • sandbox
This module generates a list of linked letters to navigate the pages listed in categories. It uses Module:table of contents.
Usage
{{cattoc|key1|key2|...|keyn|lang=langcode}}
generates category index keys 1 to n, separated by spaces.
{{cattoc|lang=langcode|top=Top}}
generates category index link to the top of the category.
For example, to make a simple alphabet category toc for English:
{{cattoc|lang=en|top=Top|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z}}
Top – a b c d e f g h i j k l m n o p q r s t u v w x y z
To make this look much better, and set up the layout as desired, wrap it in a wikitable:
{| class="toc plainlinks" | {{cattoc|lang=en|top=Top|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z}} |}
Top – a b c d e f g h i j k l m n o p q r s t u v w x y z |
Now you can use wikitable syntax to do whatever you like. (<span class="toc plainlinks"> ... </span> also works as expected.)
Link text
To show link text that is different from what is used in the link, use a colon. The text to the left of the colon is the position in the sort order that the link will go to, while the text to the right is what will display: {{cattoc|̄:combining macron}}
→ combining macron .
Note: You do not need to do this for sortkeys, which are handled automatically.