Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Customize backend style and UI

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 4571 Views
  • jorrie
    Avatar
    Community Member
    40 Posts

    Customize backend style and UI Link to this post

    Whats the best way to modify the backend UI a little bit?
    Ive red saphire framework let you change things but I wonder If I would like to change the TAB styling for example how to do that.

    Are there backend themes? To skin the backend?

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Customize backend style and UI Link to this post

    You can define a editor.css in your theme which is included in the backend. You could probably use this as a crude way of getting in and overriding css / images in the backend.

    If you want to customize templates or do anything more drastic then your need to make a themes/yourtheme_cms/ folder and in that you should be able to override the css, templates.

  • jorrie
    Avatar
    Community Member
    40 Posts

    Re: Customize backend style and UI Link to this post

    Thanks Willr

    So I create a /themes/myname_cms/ and copy all /images/ /css /templates from /cms/* inside that?

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Customize backend style and UI Link to this post

    Hmm just tried this myself and it looks like the path to the css files are hardcoded, I thought the links should have been themedCSS but appears not. You can try doing that. If you don't have any luck use the editor.css to override it.

  • Wilson
    Avatar
    Community Member
    63 Posts

    Re: Customize backend style and UI Link to this post

    Hey Willr,

    I'm not having any luck with this with 2.4 beta1. Is there any other way to set some custom CSS in the admin side? I need to apply 2-3 classes so nothing huge, but editor.css doesn't seem to get loaded in scope. For example,

    body.CMSMain {
       background: aqua;
    }

    doesn't show anything.

    Thanks,
    Wilson

  • jorrie
    Avatar
    Community Member
    40 Posts

    Re: Customize backend style and UI Link to this post

    Can the dev team make this non hardcoded and a setting in the config files?
    So we can easily override this?

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Customize backend style and UI Link to this post

    jorrie just had a look through the code and changing the css links to the themedCSS won't work since it'll include your themes main files but I have stumbled across another way to do it. LeftAndMain::init() has a extend() call (at least in 2.4) so you can override with a custom LeftAndMain extension.

    // mysite/code/MyCustomLeft.php
    <?php

    class MyCustomLeft extends Extension {
       
       public function init() {
          Requirements::themedCSS('admin');
       }
    }

    Then add the extension in your _config

    // add to the mysite/_config.php
    Object::add_extension('LeftAndMain', 'MyCustomLeft');

    Will load an admin.css file from your theme.

  • Wilson
    Avatar
    Community Member
    63 Posts

    Re: Customize backend style and UI Link to this post

    Wow! Thanks Willr. I really appreciate that. I'm using 2.4, so this will be really valuable. Thx!!

    4571 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.