Allow min and max header levels to be defined inline / pre node

Created on 21 March 2023, about 2 years ago
Updated 16 June 2023, almost 2 years ago

Problem/Motivation

The D7 version allowed tags like [toc min=2 max=4]. Currently we can define TOC types with different min and max header levels. However these TOC types are bound to text formats. An editor who wants to customize the TOC levels for a particular node has to create a and select a different TOC type and text format.

We would like inline max and min to be definable by content creators per node.

Does anyone else think this is a good idea? Is anyone minded to build it? If not, I would still welcome feedback: ideas, and views about how it should work: would an inline definition like [toc min=2 max=4] make sense in terms of UX, and in terms of the most straightforward way of extending the existing code? Should it be a sub-module or a feature of this module, or of toc_api?

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

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

Comments & Activities

  • Issue created by @John_B
  • Assigned to John_B
  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)

    The [toc] will currently accept one inline param, not more than one. In addition, it is rather easy to break the table of contents with extra params, which is arguably a bug.

    We cannot fix this with hook_toc_filter_alter() because we call that after removing the [toc], which is where the params are found.

  • Issue was unassigned.
  • Assigned to John_B
  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)
  • @john_b opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)
  • Issue was unassigned.
  • 🇬🇧United Kingdom John_B London (UK), Worthing (UK), Innsbruck (Tirol)
Production build 0.71.5 2024