Jump to:

23483 Posts in 18976 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Multi-line plain text field

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 779 Views
  • onion
    Avatar
    Community Member
    10 Posts

    Multi-line plain text field Link to this post

    Hi, I want my pages to be as easy as possible to edit in the CMS, and so I've stripped out many of the formatting options in the HTML Editor Field eg:

    HtmlEditorConfig::get('cms')->disablePlugins('table', 'contextmenu');
    HtmlEditorConfig::get('cms')->setButtonsForLine(1, 'bold','italic','underline','separator',   'formatselect','separator', 'sslink','unlink', pastetext', 'pasteword', 'separator','bullist','numlist','hr','charmap' );
    HtmlEditorConfig::get('cms')->setButtonsForLine(2);
    HtmlEditorConfig::get('cms')->setButtonsForLine(3);

    But in some cases I want to restrict this even more and just want a multi-line plain text field, with absolutely no chance of any formatting added. TextField is fine, but I want my editor to be able to add linebreaks. Is this possible?

  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: Multi-line plain text field Link to this post

    new TextareaField(); // plain simple textarea field

  • onion
    Avatar
    Community Member
    10 Posts

    Re: Multi-line plain text field Link to this post

    Awesome, thanks! This wasn't in the tutorial so didn't know it existed. Brilliant!

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