Readme.txt file states:

5. (optional) Visit the 'Configuration > Site Structure > Table of contents'
(/admin/structure/toc).

This is a great feature and allows total customisation of the TOCs.

However, the document does not mention anything about how to use the defined types.

I've tried [toc=simple] and [toc:simple], both return the default TOC output.

Can someone please advise how to reference a TOC type and look to add it to the documentation.

Issue fork toc_filter-2789093

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Stephen Ollman created an issue. See original summary.

xurizaemon’s picture

Agreed, this doesn't seem well documented. Right now, I think the supported syntax is:

[toc type="simple" block="true"]

Refs:

xurizaemon’s picture

Status: Active » Needs review
sandeshyadav’s picture

@xurizaemon,

The type attribute in

[toc type="simple" block="true"]

Does not work. I can confirm.

What works

block
block="true"
block="false"

title="My Title"

What does not work:

type="full"
type="default"
type="ul"
type="ol" etc.

Has anyone else figured out how to customize the type of the toc for each node?

xurizaemon’s picture

It appears the ToC types are sourced from configuration, so this may vary per site. It's also possible that ToC types aren't working in some environments, but that's outside the scope of this "Document how they work" ticket (sorry).

Here are the ToC types as they are initiated at enable of ToC API module: https://git.drupalcode.org/project/toc_api/-/tree/8.x-1.x/config/install

Here is the plugin filter configuration: https://git.drupalcode.org/project/toc_filter/-/blob/e117136b4da1f17116e...

Here is the class used just below the above link to determine the available list of ToC Types for selection in the config screen: https://git.drupalcode.org/project/toc_api/-/blob/8.x-1.x/src/Entity/Toc...

From this it appears that a site can identify the available options for type= by viewing /admin/structure/toc entities.

If those values don't work for your site, that may be a candidate for a separate issue, unless you believe it might be resolved via documentation alone.

Hope that helps! Happy to improve on this docs MR if people have feedback about the proposed changes.

VladimirAus made their first commit to this issue’s fork.

vladimiraus’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for your contribution.

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.