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

Default Content textareafield not show up


Go to End


5 Posts   3393 Views

Avatar
Sec

Community Member, 13 Posts

27 November 2008 at 2:04am

Edited: 27/11/2008 2:26am

Hi!

I am building a site containing lots of different page types. Everything is working great except that I suddenly noticed that the content textara field on every page type Page is gone. The header displays, but the dark grey box that should display the textarea field is empty.

For some of the page types I've created I use "$fields->removeFieldFromTab("Root.Content.Main","Content");" to remove this field. But I never ment to remove it from every page. I don't know if this is the reason either, because when I comment all theese lines out the content fields still does not show up.

Any suggestions?

Avatar
Sec

Community Member, 13 Posts

27 November 2008 at 3:06am

I now see that this problem happens to every HtmlEditorField, not only the default Content field. When I try adding new HtmlEditorFields they only show up with a header.

Avatar
Sec

Community Member, 13 Posts

27 November 2008 at 3:44am

Further research points the problem to the class=\"$class\" attribute in the <textarea.. output in the HtmlEditorField.php class. The $class variable contains the value "htmleditor typography". I have not edited non of these css-classes..

Anyone?

Avatar
JGC

Community Member, 25 Posts

27 November 2008 at 3:46am

Lines 82-85 of sapphire/forms/HtmlEditorField.php should be

		$class = "htmleditor";
		$class = ($this->extraClass)?$class." ".$this->extraClass:$class;
		
		return "<textarea class=\"$class\" rows=\"$this->rows\" cols=\"$this->cols\" style=\"$style\" tinymce=\"true\" id=\"" . $this->id() . "\" name=\"{$this->name}\">$cleanVal</textarea>";

Sounds like you could be missing the first of those for whatever reason.

Avatar
Sec

Community Member, 13 Posts

27 November 2008 at 4:14am

And the lesson is:

Don´t plase an empty allowed_children array like this:
static $allowed_children = array('');