Block activates region when no TOC is generated

Created on 24 February 2023, almost 2 years ago

Problem/Motivation

Hi, this may just be me not thinking through things well enough, but I've looked throughout the documentation and the module and the only thing I can find similar is the ticket: Disble block if there are no items for the Table of Contents ( https://www.drupal.org/project/table_of_contents/issues/3061906 β†’ ).

The patch from that bug report is in place in version 2.0.1, but my problem goes a bit further.

When I put the block in the Sidebar of my theme and there's no TOC generated, the module doesn't show up, but the region is still activated. Is there a way for the block not to show up AND for the region not to be activated if no TOC is generated? The effect is that the sidebar region leaves a huge whitespace on the side of my page.

Normally, I'd just exclude pages using the block's page filter, but I'm looking at a site with thousands of pages that will expand and contract over time, so being able to have the region not activate when there's nothing to show would be a huge headache-saver

Thank you

Steps to reproduce

\

  1. Set up TOC Block
  2. Place it in a region that displays based on whether there are active blocks in it.
  3. Verify that it's working
  4. Go to a page that doesn't generate a TOC
  5. Note that the region is active even though nothing is being generated.
πŸ’¬ Support request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rex.barkdoll

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

Comments & Activities

Production build 0.71.5 2024