The TinyMCE configuration introduces the height => 'auto' property, this will help set the height value for some nested elements.
This height value will override the value specified in the _config.php file, if there is one.
Therefore, when using this setRows method, it is worth considering that the height specified in _config.php file will not be taken into account.
Test steps
Update Page.php with the following code.
use use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
class Page extends SiteTree
{
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeByName('Content');
$fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent1')->setRows(2));
$fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent2')->setRows(4));
$fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent3')->setRows(5));
$fields->addFieldToTab('Root.Main', HTMLEditorField::create('OtherContent4')->setRows(10));
return $fields;
}
}
Fields should have height 20pxpassed value to setRows, E.g. setRows(2) = 20px 2 = 40px;
Description
The TinyMCE configuration introduces the
height => 'auto'
property, this will help set the height value for some nested elements. Thisheight
value will override the value specified in the_config.php file
, if there is one. Therefore, when using thissetRows
method, it is worth considering that the height specified in_config.php
file will not be taken into account.Test steps
Update Page.php with the following code.
20px
passed value to setRows
, E.g. setRows(2) = 20px 2 = 40px;Parent issue