Problem/Motivation

Core provides derived Entity bundle visibility conditions for bundled entity types, including custom content entities. However, those derived conditions only appear in the block visibility UI when a matching route context is available. Node has a dedicated route context provider, so blocks can be conditionally displayed by node bundle on node canonical pages. Custom content entities with canonical routes, such as CRM contacts, do not get an equivalent route context automatically. As a result, the built-in entity bundle condition exists but is not shown in the block UI for those entity types.

Steps to reproduce

Create a bundled custom content entity type with a canonical route, for example /crm/contact/{crm_contact}. Ensure the route parameter is typed as entity:crm_contact. Go to the block layout UI and configure a block's visibility settings. The entity bundle visibility condition for the custom entity type is not available, even though core has derived an entity_bundle:crm_contact condition plugin.

Proposed resolution

Provide a generic route entity context provider in core, or otherwise extend the existing context system, so canonical entity route parameters can expose available contexts for custom content entity types. This would allow existing derived entity bundle visibility conditions to appear in the block UI without each custom entity type needing to implement its own route context provider.

Remaining tasks

Confirm the expected scope for generic entity route contexts. Add or update tests covering block visibility UI availability for bundled custom content entities. Ensure existing entity-specific providers, such as node's route context provider, continue to work as expected or can safely coexist with the generic provider. Add change record documentation if the new behavior affects contributed/custom entity types.

User interface changes

The block visibility UI would show entity bundle visibility conditions for eligible custom content entity types on routes where the current route provides that entity as a context. Site builders could configure blocks to show or hide by custom entity bundle, similar to configuring blocks by node bundle.

API changes

A new generic entity route context provider may be added, or the context repository behavior may be expanded to expose entity contexts from typed route parameters. Custom entity types should no longer need to copy entity-specific route context provider code solely to make core's existing entity bundle condition available in the block UI.

Data model changes

None.

Comments

bluegeek9 created an issue.