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

SiteTree width


Go to End


4 Posts   2140 Views

Avatar
kylehudson00

Community Member, 22 Posts

8 March 2013 at 8:25pm

Simple question, is there a way to customize the Site Tree's width when editing a page? Further, is there a way to make the width draggable? This would be very useful when editing blog posts - the default width is too skinny.

Avatar
micahsheets

Community Member, 165 Posts

10 March 2013 at 9:50am

I was also going to write a post on this subject. The element <div id="cms-content-tools-CMSMain"> really needs to be wider by default. If this area is a ModelAdmin search area that has an import field then the Browse button is always cut off. If it is a site tree listing then the status of the page is cut off or not visible if the page name is too long. Being able to resize this is extremely important.

Avatar
kylehudson00

Community Member, 22 Posts

26 July 2013 at 3:15pm

There is a months-old open ticket on this (not started by me): https://github.com/silverstripe/silverstripe-framework/issues/1565

This really is something that needs to be addressed. The width of the site tree needs to be dynamic - at the very least, a higher 'min-width' value needs to be applied. I've tried to fix it myself, but the relevant CSS seems to be inline so I'm assuming it's injected via javascript at some point - but I can't find where. Any pointers?

Avatar
sekjal

Community Member, 7 Posts

29 January 2016 at 5:02am

Edited: 29/01/2016 5:25am

My solution:

Create a CSS file myLocalCMSStyles.css, and add

.cms-content-tools .cms-panel-content {
    width: 284px;
}

(replace with your desired with; this will set it to 300px when all the padding/margins are added). The javascript that injects the styling into the element inline consults the stylesheet for the inner element, so that's how we can get a foothold.

Then, in _config.php, add a line:

 LeftAndMain::require_css('path/to/myLocalCMSStyles.css');

Do a ?flush=1, and your SiteTree menu should now be wider.