Question about multi-leveled table of contents

Created on 17 June 2025, about 2 months ago

First of all, thank you for maintaining this useful module!

I seem to be a bit late with this issue, because I haven't been following how this module has developed during the years - sorry about that!. Anyway, I have been using the old 2.x version for quite a long time until only recently I noticed it was marked as unsupported. I don't know why I hadn't noticed it before. Well, now as I updated it to 3.2.0 I noticed the table of contents is now multileveled, which seems to be an intended move in https://www.drupal.org/node/3466879

Unfortunately this caused an issue with my theming because it has been themed assuming it's never multileveled (I mean, no nested hierarchical ul > li elements and h2, h3 etc. levels are all in the same flat level).

I was wondering is there any easy or simple way to have a setting that would make the table of contents "flat" without nested levels? I tried to look into the code a bit, but soon noticed the nested levels are coming from the main toc js library (which is now included with the module).

Or are my options just to keep using the old 2.1 version or revamp my theme for table of contents?

Thanks!

💬 Support request
Status

Active

Version

3.2

Component

Miscellaneous

Created by

🇫🇮Finland hartsak

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024