⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Tocify adds a Backdrop block that auto-generates a scroll-synced table of contents with tocbot. It scans page headings, injects anchor IDs, and renders a configurable, collapsible TOC with smooth scrolling and active-link highlighting, plus admin controls for selectors, offsets, list style, and classes.

License

Notifications You must be signed in to change notification settings

backdrop-contrib/tocify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tocify

Provides a configurable Table of Contents (TOC) block for Backdrop CMS using the tocbot library. It scans page headings, assigns anchor IDs, and renders a scroll-synced, collapsible TOC with customizable classes and behavior.

Requirements

  • Backdrop CMS 1.x
  • jQuery (core)

Installation

  1. Place this module in modules/custom/tocify.
  2. Enable Tocify at /admin/modules.

Configuration

  • Go to Configuration » User interface » Tocify (/admin/config/user-interface/tocify).
  • Key options:
    • Content container selector: CSS selector for the content area to scan (default .node-content).
    • Heading selector: Comma-separated heading tags to include (default h1, h2, h3).
    • Scroll offset: Pixels to offset scrolling for fixed headers (default 80).
    • Collapse depth: Heading levels to keep expanded (default 6).
    • Smooth scroll / Ordered list / Include HTML: Toggle behaviors and markup handling.
    • Advanced: Classes, fixed-position selectors, offsets, throttle time, and scroll-sync toggle.

Usage

  • Add the block Table of Contents (Tocify) to a region (/admin/structure/layouts or block UI).
  • The block auto-renders when eligible headings are found in the target content.

Troubleshooting

  • If no TOC appears, verify the content container selector matches the page markup and that headings exist for the configured levels.
  • If headings are missing IDs, ensure JavaScript is loading and not deferred in a way that blocks tocbot.
  • For sticky/fixed behavior, confirm the configured fixed selector exists and that CSS doesn’t override positioning.

Maintainers

  • Alan Mels
  • Contributions welcome via issues/PRs.

License

  • This project is GPL v2 software.

About

Tocify adds a Backdrop block that auto-generates a scroll-synced table of contents with tocbot. It scans page headings, injects anchor IDs, and renders a configurable, collapsible TOC with smooth scrolling and active-link highlighting, plus admin controls for selectors, offsets, list style, and classes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published