Difference between revisions of "Template:TOC"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m (Created (based on Wikipedia's CompactTOC8))
(No difference)

Revision as of 17:45, 13 August 2011

Contents
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

Description

This is a replacement Table of Contents for alphabetical lists:

  • The "Contents" or a custom heading can go on top (default) or the side (side=yes).
  • Letters can be omitted and/or ranges set instead of 26 individual letters: A B C-F G H-K L ...
  • Other options include: center=yes, num=yes, top=yes, seealso=yes, etc.

Usage

Typical

{{TOC}}

{{TOC|symnum=yes}}

Complete

{{TOC
|name    =
|side    = yes
|center  = yes
|right   =
|align   = center
|nobreak = yes
|top     = yes
|num     = yes
|sym     = yes
|symnum  =
|seealso = yes
|a       =
:
|z       =
}}

Parameters

Parameter Description name replaces the "Contents" heading with an alternative name, or hide it completely by entering name=no
side places the "Contents" heading on the left side with a colon, instead of the top without one
align centres to TOC in the horizontal middle of the page, instead of floated left
right aligns the TOC horizontally to the right of the page (may require <br style="clear:right;" /> after it, depending on page layout), instead of floated left (this parameter is mutually exclusive with the "center" option above, and should be used sparingly and with good reason)
nobreak no linebreak between the letters and the "See also" link (note: does not affect the heading; use side for that)
top enables the "Top" link; this is only useful if this copy of the TOC is a secondary TOC not at the top of the page, e.g. in the middle of a long glossary
sym enables the "!$@" link for symbolic entries section
num enables the "0–9" link for numeric entries section (create a heading of ==0&ndash;9== for the link to work)
symnum enables the "!–9" link for combined symbolic and numeric entries section (create a heading of ==!&ndash;9== for the link to work)
seealso enables link to the "See also" section
a through z individually disable particular letters that have no entries. Use with caution and check regularly to make sure that new entries do not require the removal of these parameters. Can also be used to create range links, e.g. "X-Z". (See #Letters below for more detailed documentation of this feature.)

Letters

Any letter can be omitted (i.e. when it has no entries in the list) by specifying it as a lower-case blank parameter: 

Contents
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
Contents:
A B C D E F G H I K L M N O P R S T U V W X Y Z

Or it can be replaced with an unlinked letter by using that letter (upper-case):

Contents
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
Contents:
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

Note: It is often better to create an empty place-holder span (e.g. <span id="Q" /> where the letter's heading would be in the page if it existed, since in most cases it is quite possible that it will come to exist in the future. Using the span-id avoids confusing new users who might not realize the TOC-template has skipped some letters.

The letter-assignment feature can also be used to create range links:

{{|TOC|side=yes|x=[[#X-Z|X-Z]]|y=|z=}}

Contents:
A B C D E F G H I J K L M N O P Q R S T U V W X-Z