Access Keys:
Skip to content (Access Key - 0)

toc-zone macro

Overview:

The {toc-zone} macro displays a table of contents based on headings contained within it...

If you have a lot of information on a page, it's a good idea to break it in to sections by using Headings in order to make it more readable. This macro allows you to split a table of contents (or flat navigation bars) based on those headings in to smaller sections by only listing headings that are contained within the macro.

This tutorial will focus on the unique features of the {toc-zone} macro. For examples on all the other features of this macro, please see the toc macro.

The key differences between the {toc-zone} macro and the toc macro are:

  • {toc-zone} only displays links to headings contained within the macro
  • {toc-zone} has a "location" parameter
  • {toc-zone} defaults the "type" parameter to flat

Parameters:

The {toc-zone} macro has the following parameters:

{toc-zone:parameters}
Your content including one or more headings
{toc-zone}
Parameter Required Default Notes
location both This parameter allows you to specify where the table of contents should be displayed, either top or bottom of the content contained within the macro. If you do not specify anything with this parameter then the contents will be displayed at both the top and bottom of the content.
type list The type of output, either:
  • flat (default) - a flattened (single line) list
  • list - a hierarchical list of links to headings
class   An optional CSS class to associate the table with. If specified, no other formatting information will be used (style, indent, etc) allowing you full control over the display.
style   The style of bullet point to use for each item when using the list type:
indent 10px When using the list type, this parameter set the indentation to use for each nested level of the contents. Any valid CSS size value can be used, but remember to specify the units (e.g. "px" for pixels).
separator brackets When using the flat type, this parameter defines how individual items will be separated from one another:
  • brackets (default) - items will be enclosed in \square \brackets
  • brace - items will be enclosed in {curly} {braces}
  • parens - items will be enclosed in (normal) (brackets)
  • pipe - items will be separated | by | pipes
  • Anything else - a custom separator
minLevel 1 The minimum heading level to include in contents list - a number between 1 and 6 corresponding to the heading level. Must be less than or equal to the "maxLevel" parameter.
maxLevel 6 The maximum heading level to include in contents list - a number between 1 and 6 corresponding to the heading level. Must be greater than or equal to the "minLevel" parameter.
includePages false If set to true, then the contents will also include any headings within included pages within the current page.
filter   Allows you to use a Regular Expression to filter headings based on matching criteria. Not for the feint hearted!
printable true If set to false the table of contents will not be displayed in a print preview.
outline false If set to true, items will be uniquely numbered in a 1.2.3 style.


Examples:

Hints and Tips

Because this macro is generally used for navigational purposes within the web browser, you should set the "printable" parameter to false to hide the table of contents (as it will no longer be needed) when printing.

Frequently Asked Questions

Q Can I display a full table of contents for all headings on a page?
A Yes. Use the toc macro.

See Also



Ask questions, get help and report bugs & issues on our Community Site

View old comments


Adaptavist Theme Builder Powered by Atlassian Confluence