Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SilverStripe admin area overwrite

Tags:

silverstripe

In SilverStripe 3.1 is it possible to overwrite the SilverStripe logo and the url (instead of replacing it) which is shown on top of the CMS on the left side?

like image 482
Steve Avatar asked Nov 19 '13 18:11

Steve


3 Answers

In SilverStripe 3.1 we can overide the logo by using some custom css.

First we tell LeftAndMain to include an extra css file by adding this to our config.yml:

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

Then in our leftandmainextracss.css file we can edit the default logo css to load whatever 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

There are some details on extending the cms interface here: 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 CMS branding. I have not tested this: https://github.com/skorp/Silverstripe--CMSbranding

like image 175
3dgoo Avatar answered Nov 18 '22 23:11

3dgoo


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

LeftAndMain:
  extra_requirements_css: [mysite/css/leftandmainextracss.css]
like image 25
muskie9 Avatar answered Nov 18 '22 21:11

muskie9


For SilverStripe 4 it has to be with namespaces:

SilverStripe\Admin\LeftAndMain:
  extra_requirements_css:
    - mysite/css/leftandmainextracss.css
like image 1
ivoba Avatar answered Nov 18 '22 21:11

ivoba