Overwrite SilverStripe admin area

In SilverStripe 3.1, is it possible to rewrite the SilverStripe logo and the URL (instead of replacing it) that appears on top of the CMS on the left side?

+6
source share
3 answers

In SilverStripe 3.1, we can redefine the logo using some custom css.

First, let's say LeftAndMain to include an additional css file by adding it to our config.yml :

 LeftAndMain: extra_requirements_css: - mysite/css/leftandmainextracss.css 

Then, in our leftandmainextracss.css file leftandmainextracss.css we can edit the default css logo to load any image we want:

 .cms-logo a { background: url("../images/new-branding-cms-logo.png") no-repeat left center; } 

We can set the url and title in our config.yml :

 LeftAndMain: application_link: 'http://www.example.com' application_name: 'Example' extra_requirements_css: - mysite/css/leftandmainextracss.css 

Below is some information about the cms extension: https://docs.silverstripe.org/en/3.1/developer_guides/customising_the_admin_interface/how_tos/extend_cms_interface/

There is also this module to change the branding of CMS. I have not tested this: https://github.com/skorp/Silverstripe--CMSbranding

+9
source

I found that I had to make one change to the above solution. When declaring extra_requirements_css in config.yml I had to do it like this:

 LeftAndMain: extra_requirements_css: [mysite/css/leftandmainextracss.css] 
+1
source

For SilverStripe 4, this should be with namespaces:

 SilverStripe\Admin\LeftAndMain: extra_requirements_css: - mysite/css/leftandmainextracss.css 
+1
source

Source: https://habr.com/ru/post/958417/


All Articles