in-square / opendxp-breadcrumbs
Breadcrumbs builder for OpenDXP documents with multisite and multilanguage support.
v1.0.0
2026-03-30 13:13 UTC
Requires
- php: ^8.3
- huluti/breadcrumbs-bundle: ^1.7
- open-dxp/opendxp: ^1.0
- symfony/http-foundation: ^7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.12
- phpstan/phpstan: ^1.8
- phpstan/phpstan-symfony: ^1.2
This package is not auto-updated.
Last update: 2026-03-31 11:47:47 UTC
README
Breadcrumbs builder for OpenDXP documents with multisite and multilanguage support.
Requirements
- PHP 8.3+
- OpenDXP 1.x / Symfony 7.4
- huluti/breadcrumbs-bundle
Installation
composer require in-square/opendxp-breadcrumbs
Usage
Inject the service and generate breadcrumbs from the current document:
use InSquare\OpendxpComponents\Breadcrumbs\Breadcrumbs; use OpenDxp\Model\Document; public function defaultAction(Document $document, Breadcrumbs $breadcrumbs): Response { $breadcrumbs->generateDocumentBreadcrumbs($document); return $this->render('default/default.html.twig'); }
Add extra items (for example, object details):
$breadcrumbs ->generateDocumentBreadcrumbs($document) ->addItem($object->getName(), $objectUrl);
Behavior
- Skips
LinkandFolderdocuments, and documents withnavigation_exclude. - Resolves label from
navigation_nameproperty, thentitle, thenkey. - Determines the language root by walking up the parents and stopping at the last
document with the same explicit
languageproperty as the current page. - Uses the current request host to build absolute URLs.
Rendering
The component uses huluti/breadcrumbs-bundle, so you can render in Twig:
{{ wo_render_breadcrumbs() }}
Configure the view template in config/packages/huluti_breadcrumbs.yaml as needed.