Easy Breadcrumb
Provides configurable path-based breadcrumbs that extend Drupal's core system breadcrumb with the current page title and numerous customization options.
easy_breadcrumb
Install
composer require 'drupal/easy_breadcrumb:^2.0'
Overview
Easy Breadcrumb is a highly configurable breadcrumb module that enhances Drupal's core breadcrumb functionality. It automatically builds breadcrumbs based on the current URL path alias and the page title, providing a user-friendly navigation aid without requiring manual configuration for each page.
The module works out of the box with sensible defaults but offers extensive customization options including: control over which segments appear in the breadcrumb trail, title transformation modes (capitalization), custom breadcrumb paths using regex patterns, title replacements, path exclusions, and support for taxonomy term hierarchies.
A key feature is the ability to output breadcrumb data as JSON-LD structured data for SEO purposes, helping search engines understand your site's hierarchy. The module also integrates with the Redirect module to follow URL redirects when building breadcrumbs.
Features
- Automatically includes the current page title as the last breadcrumb segment
- Builds breadcrumbs from URL path aliases for consistent navigation
- JSON-LD structured data output for SEO (Schema.org BreadcrumbList)
- Configurable home/front page segment with custom title
- Multiple title transformation modes: capitalize each word, first letter only, all uppercase, or force specific words
- Custom breadcrumb paths with regex pattern support for complex URL matching
- Title replacement rules to customize segment display names
- Path exclusion rules to hide specific paths from breadcrumbs
- Support for taxonomy term parent hierarchy in breadcrumbs
- Alternative title field support for entity-based breadcrumb titles
- Menu title fallback when page title is unavailable
- Segment limiting to control breadcrumb trail length
- Title truncation with configurable length and ellipsis
- Removal of duplicate/repeated breadcrumb segments
- Language path prefix handling for multilingual sites
- Integration with Redirect module to follow URL redirects
- Option to use absolute or relative paths for breadcrumb links
- Minimum segment count threshold before displaying breadcrumbs
- Option to enable/disable breadcrumbs on admin pages
Use Cases
E-commerce product navigation
For an e-commerce site with deep product hierarchies, configure Easy Breadcrumb to show the full path: Home > Category > Subcategory > Product Name. Enable 'Use the real page title when available' to show actual product names, and enable 'Add parent hierarchy' for taxonomy-based category pages to automatically include parent categories.
SEO-optimized breadcrumbs
Enable 'Add current breadcrumb as structured data' to output JSON-LD markup in the HTML head. This helps search engines understand your site hierarchy and may display breadcrumb trails in search results. Ensure 'Include the current page as a segment' is enabled for complete breadcrumb data.
Multilingual site breadcrumbs
For sites using language path prefixes (/en/, /de/, /fr/), configure whether to show the language prefix as a breadcrumb segment. By default, the language prefix is hidden from breadcrumbs for cleaner navigation.
Custom branded breadcrumbs
Use the 'ucforce' capitalization mode combined with 'Words to be forced to capitalized' to ensure brand names, product names, or acronyms always appear with consistent capitalization in breadcrumbs, regardless of how URLs are structured.
Blog with clean URL paths
For a blog structure like /blog/category/2024/my-article-title, use the 'Paths to be excluded' feature to hide date segments (2024) from breadcrumbs, resulting in cleaner navigation: Home > Blog > Category > My Article Title.
Landing page breadcrumbs
Use 'Paths to replace with custom breadcrumbs' to define specific breadcrumb trails for landing pages that don't follow the site hierarchy. For example, a campaign page at /spring-sale could have a custom breadcrumb: Home > Sales > Spring Sale, even if no 'Sales' page exists.
Alternative title field for SEO
Add a field named 'field_breadcrumb_title' (or configure your own) to content types. This allows editors to specify shorter or keyword-optimized titles that appear only in breadcrumbs, separate from the full page title. For example, a page titled 'Complete Guide to Drupal Module Development for Beginners' could have a breadcrumb title of simply 'Module Development Guide'.
Hide breadcrumbs on simple pages
Use 'Breadcrumb segment minimum count' to hide breadcrumbs on pages that would only show 'Home' or very short trails. Set to 2 or 3 to only display breadcrumbs when there's meaningful navigation hierarchy.
Tips
- The module works immediately after installation with sensible defaults - no initial configuration required
- Use the 'Alternative title field' feature to give content editors control over breadcrumb text without affecting the page title
- When defining custom paths with regex, use parentheses to capture groups that can be referenced with $1, $2, etc. in segment URLs
- The 'ucwords' capitalization mode respects common lowercase words like 'of', 'and', 'the' - customize this list for your language
- Enable JSON-LD structured data for better SEO - Google may display your breadcrumbs in search results
- For large sites, use path exclusions to hide utility paths like /search or /ajax from breadcrumbs
- The <title> placeholder in custom paths lets you use the actual page title in custom breadcrumb definitions
- Consider setting a minimum segment count of 2 to avoid displaying breadcrumbs that only show 'Home'
- When using the Redirect module, enable 'Follow redirects' to ensure breadcrumbs reflect the canonical URL structure
Technical Details
Admin Pages 1
/admin/config/user-interface/easy-breadcrumb
Configure all aspects of the Easy Breadcrumb module including segment display, title transformations, custom paths, exclusions, and SEO settings.
Permissions 1
Hooks 1
hook_system_breadcrumb_alter
Drupal core hook that Easy Breadcrumb respects. Allows other modules to alter the breadcrumb before it is rendered. Easy Breadcrumb invokes this hook when generating JSON-LD structured data.
Troubleshooting 8
Ensure the System Breadcrumb block is placed in a region in your theme's block layout. Easy Breadcrumb enhances the existing system breadcrumb block rather than providing its own. Also check that the page has enough segments to meet the 'Breadcrumb segment minimum count' setting.
Enable 'Use the real page title when available' in the Easy Breadcrumb settings. If using Views pages, ensure the View has a proper page title configured. For custom routes, ensure they define _title or _title_callback.
Enable 'Remove repeated identical segments' in the settings. If duplicates still appear with different URLs, also enable 'Remove repeated identical segments - only validate on the text' to remove segments based solely on matching text.
Enable 'Add current breadcrumb as structured data' in the settings. The JSON-LD is only added when the System Breadcrumb block is rendered, so ensure the block is placed and visible. Check the page source for a <script type="application/ld+json"> tag in the head.
Check if 'Applies to administration pages' is enabled in the settings. When disabled, admin routes use Drupal's default breadcrumb builder instead of Easy Breadcrumb.
For regex-based custom paths, ensure the pattern is prefixed with 'regex!' and the slashes are properly handled. Test patterns incrementally. For non-regex paths, ensure the path matches exactly (with or without leading slash as configured).
Enable 'Add parent hierarchy' in the Advanced settings. This only applies when viewing taxonomy term pages directly, not content that references terms.
Clear Drupal's cache after changing Easy Breadcrumb settings. Breadcrumbs are cached per route and URL path. Use drush cr or the Performance page to clear caches.
Security Notes 3
- The module filters all user-provided titles through Drupal's XSS filtering to prevent script injection
- Custom path configurations are only accessible to users with the 'administer easy breadcrumb' permission
- Access checks are performed for each breadcrumb segment - users only see links to pages they can access