Change toolbar style depending on class



I have a rather specific question.
Basically my PIM consists of three object classes.
They are called: “Motiv”, “Artikel” and “Sammelartikel”.

Is there a simple way to check, which class the currently opened object belongs to and then change the style of the toolbar, for example change the color of the whole toolbar?

I mean this part.

Is this possible? Or would I have to put a lot of work in it


You can get the class of the opened object like this:

from there on you can customize whatever you want.


So I have to create a bundle to do this? Or is it possible via EventListener for example?


No, your AppBundle needs to implement PimcoreBundleInterface or extend from AbstractPimcoreBundle and you need load additional javascript into Pimcore Backend.



okay sorry, I have no idea how to do this.
Therefore my question was, is it possible in an easy way.

Unfortunately I never did something like this before


Just go ahead and follow the Pimcore Bundle Instructions in the docs. It is actually quite easy to do… Don’t be afraid :wink: