Table of Contents Macro

The Table of Contents macro generates a table of contents based on XWiki headings. This macro can also be used with the Box macro.

Usage

{{toc start="<start>" depth="<depth>" numbered="<true|false>" scope="<local|page>" reference="<Page Reference>" /}}

Parameters

NameOptionalAllowed valuesDescriptionDefault value
startYes1 to 6The initial level where the table of contents generation should start at. The reason why the second level is the default value is the fact that level 1 is considered as the document title.2
depthYes1 to 6The maximum level the table of contents is generated for.6
numberedYes
  • true
  • false
A flag stating whether the macro should generate numbering for titles.false
scopeYes
  • page
  • local
If the scope is local, only the sections in the current scope will be listed. For instance, in case the macro is called within a section, only its subsections will be listed.page
referenceYesPage referenceThe page for which to generate the table of content.If not specified, generate a TOC for the current page.

Examples

Numbered ToC

{{toc start="1" depth="2" numbered="true" scope="page"/}}
= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

will display

TocMacro.png

Using the scope parameter

{{toc start="1" depth="3" scope="page"/}}
= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

will display

TocMacro2.png

The ToC macro used with the Box macro

{{box cssClass="floatinginfobox" title="**Summary**"}}
{{toc/}}
{{/box}}
= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

TocMacro3.png

Using a custom CSS

The custom CSS can be included in a StyleSheetExtension object attached to the page. For the below example the CSS rules for the ".box.floatinginfobox" class are:

.box.floatinginfobox ul{
 list-style-type: lower-greek;
 color: #480000;
}

.box.floatinginfobox a:link{
 color: #480000;
}
{{toc /}}

= General Remarks =

= Paragraphs =

= Links =

== XWiki Syntax 1.0 Link Specification ==

=== XWiki Syntax 1.0 Image Specification ===

will display

TocMacro4.png

Related Pages

Search this space

 

Most popular tags

Failed to execute the [groovy] macro
  1. access rights
  2. activity stream
  3. annotation
  4. attachment
  5. comment
  6. Document Tree Macro
  7. export
  8. Extension Manager
  9. Flamingo skin
  10. global user
  11. Groovy event listener
  12. group
  13. nested page
  14. search
  15. skin
  16. syntax
  17. user
  18. user profile
  19. velocity macros
  20. wiki
  21. wysiwyg
  22. XWiki Applications
  23. xwikiattachment_archive table
  24. xwikiattachment table
  25. xwikiattrecyclebin table
  26. xwikiproperties table

[Display all tags from this space]