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.

CommentFileSizeAuthor
#4 3072743.patch4.95 KBdrumm
#2 3072743.patch4.52 KBdrumm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm created an issue. See original summary.

drumm’s picture

Status: Active » Needs review
FileSize
4.52 KB

The attached patch also looks through the default panel configuration for each entity type and bundle, when Panelizer is enabled and being used.

drumm’s picture

drumm’s picture

FileSize
4.95 KB

I noticed that table_of_contents_block_info() is invoked multiple times per page request by CTools’s content types system. Since this is always calling variable_set('table_of_contents_definitions', …), that is a good amount of cache thrashing. This patch only updates the variable when it has changed.

  • grasmash committed 4e3d084 on 7.x-2.x authored by drumm
    Issue #3072743 by drumm: Allow configuring block when field is only...
grasmash’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.