Change toolbar style depending on class


#1

Hi,

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


#2

You can get the class of the opened object like this: https://github.com/coreshop/CoreShop/blob/master/src/CoreShop/Bundle/CoreBundle/Resources/public/pimcore/js/coreshop.js#L486

from there on you can customize whatever you want.


#3

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


#4

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


#5

Hi,

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


#6

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