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.

Customising the CMS

how to change width of HTMLEditorField


Reply

5 Posts   1147 Views

Avatar
astate

19 February 2011 at 2:31pm (Last edited: 20 February 2011 2:58am), Community Member, 35 Posts


Hello,
I dont see new field.


I use this /dev/build?flush=1 to create tables and field. (Database build completed!) but no field are create.


(sorry for my language, i am french of canada)

second question:

now i search how to change width of HTMLEditorField in admin section because I want to it in vertical columns

I have and a Requirements::css in php code.
the css field have this inside

form htmleditor {
width: 248px;
}

thanks

Avatar
Willr

19 February 2011 at 4:20pm Forum Moderator, 5511 Posts

$fields->addFieldToTab('Root.Content.Nouvelles', new TextField('Nouvelles'), 'Nouvelles');

The 3rd parameter to addFieldToTab() is the field name you want the field to appear above so what you're saying in that line is you want the text field to appear above itself which doesn't really work! SilverStripe simply won't add the field. Take off the 3rd parameter.

$fields->addFieldToTab('Root.Content.Nouvelles', new TextField('Nouvelles'));

Avatar
astate

19 February 2011 at 4:23pm (Last edited: 20 February 2011 2:55am), Community Member, 35 Posts

ok thanks

now i search how to change width of HTMLEditorField in admin section because I want to it in vertical columns

I have and a Requirements::css in php code.
the css field have this inside

form htmleditor {
width: 248px;
}

Avatar
Willr

20 February 2011 at 10:15am Forum Moderator, 5511 Posts

If you want vertical columns there are a number of things you have to do, you need to set the width in the CSS but also in the HtmlEditorConfig class. On top of that you will need to float the divs so they all stack up next to one another using float: left or positioning them using relative positioning (or absolute would be easier)

Avatar
astate

21 February 2011 at 2:54am (Last edited: 21 February 2011 9:53am), Community Member, 35 Posts

If i change the HtmlEditorConfig class all type page are modified in admin section. I only need this for one type page How i can do this ?