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.

We've moved the forum!

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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

page types with two HTMLEditorField types do not display the label for the second one


Go to End


3 Posts   1746 Views

Avatar
Colin

Community Member, 15 Posts

5 August 2007 at 7:30pm

I have the following page code and while the HTMLEditor textarea for the second field displays, the label for it does not. Attached is my page code and the edit interface screenshot.

Avatar
Nathan Cox

Community Member, 99 Posts

6 August 2007 at 12:30am

Edited: 06/08/2007 12:32am

HTMLEditorFields and TextareaFields don't seem to show a title unless you specify one, which is acutally pretty handy if you want a bigger space to edit in.
Adding a title parameter to HTMLEditorField will do what you want:

function getCMSFields() {
	$fields = parent::getCMSFields();

	$fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('Sidebar', 'Sidebar'), 'Content');
	$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');

	return $fields;
}

Avatar
Colin

Community Member, 15 Posts

6 August 2007 at 2:47am

Thanks, that seems to have done it.