Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It is possible to enable the TOC block, via core blocks or Panelizer, for a field when it is set to display with the table_of_contents_text
formatter. This works, but if the field is shown via Panelizer only, with the core field display hidden, this gets quite brittle.
Comment | File | Size | Author |
---|---|---|---|
#4 | 3072743.patch | 4.95 KB | drumm |
Comments
Comment #2
drummThe attached patch also looks through the default panel configuration for each entity type and bundle, when Panelizer is enabled and being used.
Comment #3
drummComment #4
drummI noticed that
table_of_contents_block_info()
is invoked multiple times per page request by CTools’s content types system. Since this is always callingvariable_set('table_of_contents_definitions', …)
, that is a good amount of cache thrashing. This patch only updates the variable when it has changed.Comment #6
grasmash CreditAttribution: grasmash at Acquia commented