Component written in HTL and HTTP Request Filter that renders a table of contents(TOC) to help navigate the page content.
This component requires the TableOfContentsFilter to be enabled through an OSGi configuration before it can be used. On AEMaaCS the filter is not enabled by default, the configuration needs to be deployed using the full-stack pipeline.
- List Type - Whether to list items in the table of contents as an unordered list of bullet points, or as an ordered list of numbers.
- Title Start Level - The highest title level to report in the table of contents, where
H1
corresponds toh1
and includes all top-level titles. - Title Stop Level - The lowest title level to report in the table of contents, where
H6
corresponds toh6
and includes all lowest-level titles. - Styles
The Table of Contents component uses the com.adobe.cq.wcm.core.components.models.TableOfContents
sling model as its use-object.
The following configuration properties are used:
./restrictListType
- defines whether the author should be able to choose the list type or not -norestriction
orbulleted
ornumbered
./restrictStartLevel
- defines whether the author should be able to choose the highest title level to report in the TOC -norestriction
orH1
toH6
./restrictStopLevel
- defines whether the author should be able to choose the lowest title level to report in the TOC -norestriction
orH6
toH1
./includeClasses
- defines an array of strings representing the configured class names to include in the TOC../ignoreClasses
- defines an array of strings representing the configured class names to ignore in the TOC.
The following properties are written to JCR for this Table of Contents component and are expected to be available as Resource
properties:
./listType
- defines the list type of the TOC -bulleted
ornumbered
./startLevel
- defines the lowest title level to report in the TOC -H1
toH6
./stopLevel
- defines the highest title level to report in the TOC -H6
toH1
./id
- defines the component's HTML ID attribute.
BLOCK cmp-toc__content
ELEMENT <ol/> or <ul/>
- Vendor: Adobe
- Version: v1
- Compatibility: AEM 6.5
- Status: production-ready
- Documentation: https://www.adobe.com/go/aem_cmp_tableofcontents_v1
- Component Library: https://www.adobe.com/go/aem_cmp_library_tableofcontents
- Author: Vishal Singh Arya