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.


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

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

Default Content textareafield not show up


5 Posts   2306 Views


27 November 2008 at 2:04am (Last edited: 27 November 2008 2:26am), Community Member, 13 Posts


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?       


27 November 2008 at 3:06am Community Member, 13 Posts

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.


27 November 2008 at 3:44am Community Member, 13 Posts

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..



27 November 2008 at 3:46am Community Member, 25 Posts

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.


27 November 2008 at 4:14am Community Member, 13 Posts

And the lesson is:

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