Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ezplatform Admin Ui Entrypoint Components Laravel Package

bluetel/ezplatform-admin-ui-entrypoint-components

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require bluetel/ezplatform-admin-ui-entrypoint-components
    

    Ensure your project uses eZ Platform 7.x (compatible with the package's last release).

  2. Bundle Registration Add the bundle to config/bundles.php:

    return [
        // ...
        BluTel\EzPlatform\AdminUi\EntryPointComponentsBundle\BluTelEzPlatformAdminUiEntryPointComponentsBundle::class => ['all' => true],
    ];
    
  3. First Use Case

    • Add a custom entry point (e.g., a button/link in the admin toolbar):
      {% 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 %}
      
    • Override default entry points (e.g., modify the "Content" menu):
      # 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' }
      

Implementation Patterns

Common Workflows

  1. 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 %}
    
  2. 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' }
    
  3. Integration with eZ Platform Features

    • Content Type-Specific Entry Points:
      {% 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 %}
      
  4. 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/
    

Gotchas and Tips

Pitfalls

  1. Route Configuration

    • Ensure routes exist before using them in entry points. Test routes with:
      php bin/console debug:router
      
    • Error: No route found for "nonexistent_route" → Verify route names in YAML/Twig.
  2. Priority Conflicts

    • Entry points with the same position may render unpredictably. Use unique values (e.g., 100, 200).
    • Debug: Inspect rendered HTML to check order:
      php bin/console debug:container | grep entrypoint
      
  3. Caching Issues

    • Clear cache after adding/removing entry points:
      php bin/console cache:clear
      
    • Symptom: Entry points not appearing → Check var/cache/dev/ for stale templates.
  4. Icon Dependencies

    • Use Font Awesome icons (e.g., fa fa-edit). Custom icons require:
      • Adding CSS/JS assets.
      • Updating the icon attribute in Twig/YAML.

Debugging Tips

  • Log Entry Points: Add a debug dump in a custom template:
    {{ dump(ez_admin_ui_entrypoints()) }}
    
  • Check Bundle Load Order: Ensure BluTelEzPlatformAdminUiEntryPointComponentsBundle loads after EzPlatformAdminUiBundle in config/bundles.php.

Extension Points

  1. 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 }
    
  2. 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);
    }
    
  3. 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'
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor