I added new HtmlEditorField(s) to the main tab and all is fine.
However, the label for the field is floated to the left instead of sitting above the field like the default "Content" field.
Cheers,
Trev
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
I added new HtmlEditorField(s) to the main tab and all is fine.
However, the label for the field is floated to the left instead of sitting above the field like the default "Content" field.
Cheers,
Trev
Can anybody provide some insight?
Bumpity bump
Hello,
I too was looking into how to make the HTMLEditorField underneath the label, and after playing around with CSS in Developer Tools in FireFox,
I have found out that the default "Content" Field has a class named "stacked" added to the
<div id="Content" class="field htmleditor stacked">
but in the other HTMLEditorField(s) that developers add using $fields don't. I will figure out how to get those added by $field stacked and let you know how I go.
for now you can add custom javascript
$('#Content').addClass('stacked');
where #Content is the id of the div you added
You don't need to use Javascript to add a class at all.
In getCMSFields(), do the following:
$myField = new HTMLEditorField('MyHTMLField', 'My HTML Field');
$myField->addExtraClass('stacked');