Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Re-skining the CMS


Go to End


5 Posts   1635 Views

Avatar
Mo

Community Member, 541 Posts

5 October 2009 at 10:06pm

Quick question. I know that there is a way of customising the CMS' appearance. I also know there is a forum post and a Wiki page about this, but I have been completely unable to find either.

Could anyone point me to these?

Cheers,

Mo

Avatar
Carbon Crayon

Community Member, 598 Posts

6 October 2009 at 7:45am

Hi Mo

Great work on the dashboard module, I look forward to using it on my next project :)

here is the doc's page you are looking for: http://doc.silverstripe.com/doku.php?id=recipes:rebranding-the-cms

It's not particularly extensive though.

I recently did a pretty extensive CSS rejig of the CMS by decorating LeftandMian with a new CSS requirement. That way you can do it from a module rather than having to edit the core files.

So I had a file called UIDecorator.php and it contained:

class UIDecorator extends LeftAndMainDecorator  {

	function init() {

		Requirements::CSS("lite_UI/css/lite_ui.css");
		
	}

}

then in the config file I added:

Object::add_extension('LeftAndMain', 'UIDecorator');

That then let me override all of the styles in cms/css

You could also add your JS files requirements in there for some jquery modal window stuff as per your other post.

Hope that helps :)

Aram

Avatar
Mo

Community Member, 541 Posts

6 October 2009 at 8:35am

Oh cool, thanks Aram. This will be really helpful.

Quick question though, I thought classes that are used via Object::add_extension() had to extend the Extension class?

Avatar
Carbon Crayon

Community Member, 598 Posts

6 October 2009 at 8:46am

hmm, not sure I entirely follow :s

The LeftAndMainDecorator class is an inbuilt class specially for extending LeftAndMain in this way......I don't really know much more than that :)

Avatar
Mo

Community Member, 541 Posts

6 October 2009 at 9:41am

Oh right, I image that is fine then. I just know I got an error the other day, I think i was doing something like:

class someclass extends ContentControler {
    ...
}

The error told me it should be:

class someclass extends Extension {
    ...
}

But that was probably just in that instance, so never mind :)