Warning: You are browsing the documentation from version 4 to 10 of Pimcore. Please visit https://pimcore.com/docs/platform/ for the latest versions of Pimcore.
Version: Edit on GitHub

Loading Assets in the Admin UI

If you need to load assets (JS, CSS) in the Admin or Editmode UI, you have 2 options, depending on if you do that from a Pimcore Bundle or from somewhere else.

Pimcore Bundles

Just add the PimcoreBundleAdminClassicInterface to your bundle class. The interface prescribes the following methods:

  • getJsPaths
  • getCssPaths
  • getEditmodeJsPaths
  • getEditmodeCssPaths

In order to implement all four methods prescribed by the interface you can use the BundleAdminClassicSupportTrait.

Event Based

You can add additional paths to load by handling the events defined on BundleManagerEvents. For example, to load the JS file when loading the admin UI, implement an event listener like the following (please see Events for details on how to implement and register event listeners):


namespace App\EventListener;

use Pimcore\Event\BundleManager\PathsEvent;
use Pimcore\Event\BundleManagerEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class AdminAssetsListener implements EventSubscriberInterface
    public static function getSubscribedEvents(): array
        return [
            BundleManagerEvents::JS_PATHS => 'onJsPaths'

    public function onJsPaths(PathsEvent $event)
        $event->setPaths(array_merge($event->getPaths(), [