Problem/Motivation

When only adding the breadcrumb block through layout builder the structured data isn't added to the head.

This is because Layout builder doesn't trigger the alter hook in BlockViewBuilder.php

Steps to reproduce

Add the breadcrumb block through layout builder only.

Proposed resolution

Add the structured data through a different hook that does get triggered when adding the breadcrumb block through layout builder.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nielsaers created an issue. See original summary.

nielsaers’s picture

Status: Active » Needs review
Greg Boggs’s picture

I've created an issue for this in core:

https://www.drupal.org/project/drupal/issues/3292520

Given that core moves at a careful pace sometimes, I'll go ahead and merge the workaround for us now.

  • Greg Boggs committed 32d64bc on 2.x authored by nielsaers
    Issue #3292422 by nielsaers: Structured data doesn't work if the block...
nielsaers’s picture

Aah yeah, core can take a while sometimes. Thanks for the quick merging.

Greg Boggs’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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