eca_breadcrumbs
ECA Breadcrumbs is a Drupal module that lets you customize breadcrumbs dynamically without writing code. It integrates with the ECA (Event-Condition-Action) module, allowing site builders to create complex breadcrumb rules through a visual interface.
Simply create an ECA model, listen to the "Build breadcrumb" event, add conditions based on content type or route, and configure breadcrumb items using tokens. Perfect for creating contextual navigation that adapts to your content structure, taxonomy hierarchies, or custom business logic.
Features
What does this module do?
ECA Breadcrumbs provides a flexible, no-code solution for customizing breadcrumbs on your Drupal site. It works by dispatching an event whenever a breadcrumb is being built, allowing you to intercept and
customize it using ECA rules.
Key Features:
- Build breadcrumb event - Triggered whenever Drupal builds a breadcrumb, giving you full control over the process
- Two powerful actions:
- Add breadcrumb item - Appends a single item to the breadcrumb
- Set breadcrumb items - Replaces the entire breadcrumb with custom items
- Full token support - Use any Drupal token in titles and URLs ([node:title], [current-page:url], custom field tokens, etc.)
- Automatic entity loading - Route parameters (nodes, users, taxonomy terms) are automatically available as tokens
- Flexible URL handling - Supports internal paths (/products), external URLs (https://example.com), and route names
- Condition-based logic - Show different breadcrumbs based on content type, user role, taxonomy terms, or any ECA condition
When would you use this module?
- Creating breadcrumbs that reflect your taxonomy hierarchy
- Building multi-level category navigation for e-commerce sites
- Showing different breadcrumbs based on user roles or permissions
- Adding dynamic breadcrumb items based on field values
- Creating breadcrumbs for custom routes or landing pages
- Implementing complex business logic in breadcrumb structure
Post-Installation
After installing and enabling the module, no additional configuration is required. The module automatically registers a breadcrumb builder service and makes the ECA event and actions available.
Getting Started:
- Navigate to Administration > ECA > Models (
/admin/eca) - Click Add Model to create a new ECA model
- Give it a meaningful name like "Custom Breadcrumbs"
- Click Add event and select Breadcrumb: Build breadcrumb
- (Optional) Add conditions to target specific pages:
- Node is of type - Target specific content types
- Route name matches - Target specific routes
- Entity has field - Check for specific fields
- User has role - Target specific user roles
- Add an action to create a token for entity loaded from route parameters
- Add an action:
- Breadcrumb: add item - To add a single item
- Breadcrumb: set items - To replace the entire breadcrumb
- Configure your breadcrumb items using tokens
- Save the model and test on your site
Action Configuration:
Add breadcrumb item:
- Title field: Enter the link text (supports tokens like
[node:title]) - URL field: Enter the URL or leave empty for current page (supports tokens like
/category/[node:field_category:entity:tid])
Set breadcrumb items:
- Enter one item per line in the format:
Title|URL - Leave URL empty to make the item non-clickable (current page)
- Example:
Home|/ [node:field_category:entity:name]|/category/[node:field_category:entity:tid] [node:title]|
Important Notes:
- The breadcrumb builder runs with priority 100, allowing it to override most default breadcrumb builders
- If your ECA model doesn't set any breadcrumb items, other breadcrumb builders will handle it
- Multiple ECA models can affect breadcrumbs - they execute in the order defined in ECA
- Clear cache after creating or modifying ECA models
Additional Requirements
Required modules:
- ECA (Event Condition Action) - Provides the event-condition-action framework
- Token - Required by ECA for token replacement
No external libraries required - This module uses only Drupal core APIs and the dependencies listed above.
Similar projects
How does ECA Breadcrumbs compare to other breadcrumb modules?
- Custom Breadcrumbs - Uses dedicated configuration forms per content type. ECA Breadcrumbs offers more flexibility through ECA's condition system and is better for complex logic. ECA Breadcrumbs works with tokens by design.
- Easy Breadcrumb - Automatically generates breadcrumbs from URL paths. It's simpler for basic needs but doesn't offer the customization and conditional logic of ECA Breadcrumbs.
- Breadcrumb Manager - Path-based breadcrumb configuration. ECA Breadcrumbs offers more dynamic options based on content and context rather than just paths.
Why choose ECA Breadcrumbs?
If you're already using ECA or want powerful conditional logic without custom code, ECA Breadcrumbs integrates seamlessly with your existing ECA workflows. It's ideal for complex sites with varying breadcrumb
needs based on content, taxonomy, user context, or business rules.
Supporting this Module
This module is maintained by IOSAN as part of our commitment to the Drupal community.
Ways to support:
- Report bugs and request features in the issue queue
- Contribute patches and improvements
- Share your use cases and examples in the issue queue
- Star the project if you find it useful
For professional support, customization, or Drupal development services, visit IOSAN.
Community Documentation
Resources:
- ECA Documentation: Official ECA guide - Learn about the ECA framework
- Token Documentation: Working with tokens - Understanding token syntax and available tokens
- Drupal Breadcrumbs: Breadcrumb API documentation - Core breadcrumb concepts
Examples:
Check the module's README.md file for additional examples and use cases.
Questions or Issues?
Please use the issue queue for bug reports, feature requests, and support questions. When reporting issues, please include:
- Your Drupal version
- ECA version
- Steps to reproduce the issue
- Export of your ECA model (if relevant)