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 /

SS 3.0 Best way to change HTMLEditorField rows in CMS


Reply


6 Posts   993 Views

Avatar
theoldlr

Community Member, 103 Posts

23 February 2013 at 6:36pm

Prior to 3.0 I know you used to be able to specify the number of rows you wanted in the constructor of an HTMLEditorField, but that is no longer the case. Is there a new method for changing properties of the HTMLEditorField, or perhaps a new field for shorter content in SS3 I haven't discovered yet?

Thanks!

Avatar
neilcreagh

Community Member, 98 Posts

30 March 2013 at 1:42am

Bump. Anyone got any answer for this?

Avatar
neilcreagh

Community Member, 98 Posts

16 October 2013 at 6:40am

Anyone got any answer for this in 3.1?

Avatar
zenmonkey

Community Member, 532 Posts

16 October 2013 at 7:33am

Use setRows()

HTMLEditorField::create('FieldName')->setRows(4);

Avatar
neilcreagh

Community Member, 98 Posts

16 October 2013 at 8:51am

Thanks for the reply - but struggling with this a little.
How would it be applied to this CMS field?

$fields->addFieldToTab('Root.OtherDetails', new HTMLEditorField('ContactBox', 'Contact Box'));

Thanks!

Avatar
neilcreagh

Community Member, 98 Posts

26 February 2014 at 1:12am

To answer my own question here, in case anyone else was struggling with it:

$myHTMLfield = new HTMLEditorField('FieldName', 'Title for this Field');
$myHTMLfield->setRows(4);
      
$fields->addFieldToTab('Root.Main', $myHTMLfield, '');