Use condition plugins to manage conditions

Created on 1 December 2023, over 1 year ago
Updated 19 April 2024, 12 months ago

Problem/Motivation

We sometimes need to create a breadcrumb rule that only applies to some nodes in a bundle but not all of them.
Currently, we can do that by decorating the custom_breadcrumbs.breadcrumb service and altering what applies() does but it adds custom code to maintain.

It would be more flexible if custom_breadcrumbs was using conditions plugin (like blocks do for example) instead of implementing its own condition code.

Steps to reproduce

Add a custom breadcrumb.
You can only add conditions on entity type and bundle, but not other conditions provided by condition plugins.

Proposed resolution

The module could use the ConditionManager service to get condition plugins provided by core or other modules.

✨ Feature request
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡«πŸ‡·France prudloff Lille

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

Comments & Activities

  • Issue created by @prudloff
  • πŸ‡ΊπŸ‡ΈUnited States sclsweb

    I have use cases that require this as well (i.e. custom breadcrumb on nodes of one type when they have a specific taxonomy term), and think this would be a great niche for Custom Breadcrumbs to fill, since the other breadcrumb modules don't offer it. (Path Breadcrumbs used to, RIP.)

Production build 0.71.5 2024