Finsweet Attributes

Finsweet ToC

No items found.
Overview
Attributes Notes
Finsweet Form Submit
401
Finsweet CMS Load
405
Finsweet CMS Nest
406
Finsweet CMS Sort
406
Finsweet ToC
407
Finsweet Prev Next
407
Finsweet Rich Text
408
Finsweet Input Counter
410
Finsweet CMS Filter
Finsweet CMS Filter
450
Automatic Filtering
452
Browser Extension Candies
Finsweet's Unbind CMS
3:41
501
Debugging
Troubleshooting your Finsweet Attributes Config
901
No items found.

Finsweet's ToC.

  • Provides a way to automatically generate a ToC from rich text element content.
  • Allows full styling control through the Webflow designer.
  • Generates #fragment referenceble ID's from H2's, H3's, H4's. that can be linked to externally.
  • - Does not have a built-in mechanism for adding a link for these ( like click to copy the link to heading X

Customizing

How to Style Current State in the ToC

Webflow doesn't make it easy to set the Current state on links, which makes styling FS ToC quite challenging.

Here's how I do it.

Suppress the ToC if there are no headings in the content

FS ToC doesn't run if their are no headings found in the rich text content, however this often means you'll see a ToC element of "Example H2" shown.

Here's how to suppress the ToC when there are no headings;

<script>
    function hideTocTableIfNoHeadings() {
        const richText = document.querySelector('[fs-toc-element="contents']'');
        const headings = richText.querySelectorAll('h1, h2, h3, h4, h5, h6');
        const tocTable = document.querySelector('[fs-toc-element="table"]');
        if (headings.length === 0) {
            tocTable.style.display = 'none';
        }
    }
    hideTocTableIfNoHeadings();
</script>

https://forum.finsweet.com/t/table-of-contents/2182/6

Advanced Use

To detect and perform tasks after the ToC has been constructed;

https://forum.finsweet.com/t/is-there-toc-setup-complete-event-callback/1664

Table of Contents
Did we just make your life better?
Passion drives our long hours and late nights supporting the Webflow community. Click the button to show your love.