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   836 Views

Avatar
theoldlr

23 February 2013 at 6:36pm Community Member, 103 Posts

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

30 March 2013 at 1:42am Community Member, 94 Posts

Bump. Anyone got any answer for this?

Avatar
neilcreagh

16 October 2013 at 6:40am Community Member, 94 Posts

Anyone got any answer for this in 3.1?

Avatar
zenmonkey

16 October 2013 at 7:33am Community Member, 528 Posts

Use setRows()

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

Avatar
neilcreagh

16 October 2013 at 8:51am Community Member, 94 Posts

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

26 February 2014 at 1:12am Community Member, 94 Posts

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, '');