Substitute Layout Builder host entity as source entity for Inline Block source entities

Created on 27 February 2020, almost 5 years ago
Updated 11 December 2024, 11 days ago

Problem/Motivation

For entities referenced by Inline Blocks (i.e. Custom Blocks that are created in Layout Builder and are tied to one and only one Layout Builder host entity), it would be useful to identify the Layout Builder host entity as the source entity instead of the inline block.

For example, if an editor embeds a media entity in a custom block, then the name of that custom block will appear on the media entity's usage page, along with a link to the custom block. If an editor embeds a media entity in an inline block, then the name of the entity will simply be "Inline block" and no link is provided. The editor has no way of identifying where the media entity is being used in that second instance.

Proposed resolution

For Inline Block source entities, look up their Layout Builder host entity and substitute that entity as the source entity for user-facing reporting.

Remaining tasks

  • Write patch
  • Update tests
  • Community review

User interface changes

Inline Block source entities will be replaced with the Layout Builder host entity for user-facing reporting.

API changes

None anticipated

Data model changes

None anticipated

Release notes snippet

TBD

✨ Feature request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Chris Burge

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States bkosborne New Jersey, USA

    Setup tracking of usage of both block_content and media, and the media usage data will link straight to the node the inline block is on.

    This works, but for sites using layout builder heavily, this adds a ton of additional tracking data. I have a site that only has "Media" as a source entity type to track, and I have ~40,000 items in the entity_usage table. Adding the Custom block as a source entity type balloons this to ~63,000 items. (this is mostly due to the large number of revisions we have on the site, each of which contain lots of inline blocks).

    I wonder if there's a better option out there for this. We previously hacked something together where we issued a query to the inline_block_usage table to determine the proper source entity. This resulted in an on-demand query for each "row" in the result table though.

Production build 0.71.5 2024