bluetel/ezplatform-admin-ui-entrypoint-components
Installation
composer require bluetel/ezplatform-admin-ui-entrypoint-components
Ensure your project uses eZ Platform 7.x (compatible with the package's last release).
Bundle Registration
Add the bundle to config/bundles.php:
return [
// ...
BluTel\EzPlatform\AdminUi\EntryPointComponentsBundle\BluTelEzPlatformAdminUiEntryPointComponentsBundle::class => ['all' => true],
];
First Use Case
{% extends 'EzPlatformAdminUiBundle::toolbar.html.twig' %}
{% block toolbar_items %}
{{ parent() }}
{{ ez_admin_ui_entrypoint_link({
'label': 'Custom Entry',
'icon': 'fa fa-custom',
'route': 'custom_route',
'position': 100 // Adjust priority
}) }}
{% endblock %}
# config/packages/bluetel_ezplatform_admin_ui_entrypoint_components.yaml
bluetel_ezplatform_admin_ui_entrypoint_components:
entrypoints:
content:
- { route: 'custom_content_route', label: 'Custom Content', icon: 'fa fa-custom' }
Dynamic Entry Points Use Twig functions to conditionally render entry points:
{% if app.user.hasRole('ROLE_ADMIN') %}
{{ ez_admin_ui_entrypoint_link({
'label': 'Admin Tools',
'route': 'ezplatform_admin_tools',
'icon': 'fa fa-cogs'
}) }}
{% endif %}
Grouping Entry Points Organize related entry points under a dropdown menu:
bluetel_ezplatform_admin_ui_entrypoint_components:
dropdowns:
custom_group:
label: 'My Tools'
icon: 'fa fa-th'
items:
- { route: 'tool_1', label: 'Tool 1' }
- { route: 'tool_2', label: 'Tool 2' }
Integration with eZ Platform Features
{% set contentType = ez_content.contentType %}
{% if contentType.identifier == 'article' %}
{{ ez_admin_ui_entrypoint_link({
'label': 'Edit Article',
'route': 'ezplatform_content_edit',
'parameters': { 'contentId': ez_content.id }
}) }}
{% endif %}
Custom Templates Override default templates (e.g., for dropdowns):
mkdir -p templates/BluTelEzPlatformAdminUiEntryPointComponentsBundle/
cp vendor/bluetel/ezplatform-admin-ui-entrypoint-components/Resources/views/dropdown.html.twig templates/BluTelEzPlatformAdminUiEntrypointComponentsBundle/
Route Configuration
php bin/console debug:router
No route found for "nonexistent_route" → Verify route names in YAML/Twig.Priority Conflicts
position may render unpredictably. Use unique values (e.g., 100, 200).php bin/console debug:container | grep entrypoint
Caching Issues
php bin/console cache:clear
var/cache/dev/ for stale templates.Icon Dependencies
fa fa-edit). Custom icons require:
icon attribute in Twig/YAML.{{ dump(ez_admin_ui_entrypoints()) }}
BluTelEzPlatformAdminUiEntryPointComponentsBundle loads after EzPlatformAdminUiBundle in config/bundles.php.Custom Entry Point Types
Extend the bundle by creating a new service tagging bluetel.admin_ui.entrypoint_provider:
services:
app.custom_entrypoint_provider:
class: App\EntryPoint\CustomEntryPointProvider
tags:
- { name: bluetel.admin_ui.entrypoint_provider }
Event Listeners
Listen to bluetel.admin_ui.entrypoints.build to modify entry points dynamically:
use Symfony\Component\EventDispatcher\GenericEvent;
public function onBuildEntryPoints(GenericEvent $event) {
$entrypoints = $event->getArgument('entrypoints');
$entrypoints[] = ['route' => 'dynamic_route', 'label' => 'Dynamic'];
$event->setArgument('entrypoints', $entrypoints);
}
Translation Support Translate labels dynamically:
{{ ez_admin_ui_entrypoint_link({
'label': 'ezplatform_admin_ui.entrypoint.custom.label',
'icon': 'fa fa-globe'
}) }}
Add translations in translations/messages.en.yaml:
ezplatform_admin_ui:
entrypoint:
custom:
label: 'Custom Tool'
How can I help you explore Laravel packages today?