mhinspeya/module-breadcrumbmod
Composer 安装命令:
composer require mhinspeya/module-breadcrumbmod
包简介
Magento 2 module that enhances product page breadcrumbs by displaying the full category path navigation instead of the default flat breadcrumb.
README 文档
README
A Magento 2 module that enhances product page breadcrumbs by displaying the full category path navigation instead of the default flat breadcrumb.
Compatibility
| Requirement | Version |
|---|---|
| Magento | 2.4.8+ |
| PHP | 8.2 – 8.4 |
Features
- Replaces the default product page breadcrumb with a full category path trail
- Automatically resolves the product's assigned category hierarchy
- Displays Home → Category → Subcategory → … → Product Name
- Only renders active categories that are in the root category list
- Gracefully degrades when no category is assigned (shows Home → Product Name)
Installation
Via Composer
composer require mhinspeya/module-breadcrumbmod
bin/magento module:enable MHinspeya_BreadcrumbMod
bin/magento setup:upgrade
bin/magento cache:flush
Manual Installation
- Copy the module files to
app/code/MHinspeya/BreadcrumbMod/ - Enable the module and run setup:
bin/magento module:enable MHinspeya_BreadcrumbMod
bin/magento setup:upgrade
bin/magento cache:flush
How It Works
The module uses an after-plugin on Magento\Catalog\Controller\Product\View::execute() to modify the breadcrumb block on product pages.
Flow
- Intercepts the product view page result after the controller executes
- Retrieves the current product via
ProductRepositoryInterfaceusing the request parameter - Resolves the product's category path and loads the full category collection
- Iterates through active categories and adds each as a breadcrumb crumb
- Appends the product name as the final breadcrumb item
Architecture
Plugin/Product/View.php → After-plugin on product controller
etc/frontend/di.xml → Plugin registration (frontend scope)
etc/module.xml → Module declaration with Catalog & Theme dependencies
view/frontend/layout/
catalog_product_view.xml → Ensures breadcrumbs block uses the theme template
Module Structure
MHinspeya/BreadcrumbMod/
├── Plugin/
│ └── Product/
│ └── View.php # After-plugin for breadcrumb modification
├── etc/
│ ├── frontend/
│ │ └── di.xml # Plugin DI configuration
│ └── module.xml # Module declaration
├── view/
│ └── frontend/
│ └── layout/
│ └── catalog_product_view.xml # Layout override for breadcrumbs block
├── composer.json
├── registration.php
└── README.md
Uninstallation
bin/magento module:disable MHinspeya_BreadcrumbMod
composer remove mhinspeya/module-breadcrumbmod
bin/magento setup:upgrade
bin/magento cache:flush
License
Proprietary – © MHinspeya.de by SOL.Service Online
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2026-06-29