Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Default Content textareafield not show up

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

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

Page: 1
Go to End
Author Topic: 2279 Views
  • Sec
    Avatar
    Community Member
    13 Posts

    Default Content textareafield not show up Link to this post

    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?       

  • Sec
    Avatar
    Community Member
    13 Posts

    Re: Default Content textareafield not show up Link to this post

    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.

  • Sec
    Avatar
    Community Member
    13 Posts

    Re: Default Content textareafield not show up Link to this post

    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?

  • JGC
    Avatar
    Community Member
    25 Posts

    Re: Default Content textareafield not show up Link to this post

    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.

  • Sec
    Avatar
    Community Member
    13 Posts

    Re: Default Content textareafield not show up Link to this post

    And the lesson is:

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

    2279 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.