Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » FORMS_What type of form for TinyMCE editing

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: 1617 Views
  • pouderStream
    Avatar
    Community Member
    33 Posts

    FORMS_What type of form for TinyMCE editing Link to this post

    I'm would like to edit content in two different languages and I don't know what type of form do I have do use for TinyMCE to work like it works for basic content?

  • pouderStream
    Avatar
    Community Member
    33 Posts

    Re: FORMS_What type of form for TinyMCE editing Link to this post

    I found it. It is HtmlEditField type.
    I someone would like to play with forms u can find the code in sapphire/forms/

  • sarahk
    Avatar
    Community Member
    46 Posts

    Re: FORMS_What type of form for TinyMCE editing Link to this post

    Is there a wiki entry showing each type and how to use them... or do we just look in sapphire/forms

    I have

    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Column2'), 'Left Column');

    this displays ok but can't save.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: FORMS_What type of form for TinyMCE editing Link to this post

    Admittedly this is something which is lacking in documentation.

    The HtmlEditorField takes arguments in this form: HtmlEditorField($name, $title, $rows, $cols)

    $name = code value of the field (required)
    $title = a label for the field (leave blank like "" if none wanted)
    $rows = how many rows long it should be (optional)
    $cols = how many columns long it should be (optional)

    typically you would do something like this:

    $fields->addFieldToTab("Root.Content.Main", new HtmlEditorField("RightContent,"Right Content"),"Content");

    the last ,"Content" part is only if you want to include this field before the Content field. In your case, sarahk; you need to use a code value instead of one with spaces in it.

  • sarahk
    Avatar
    Community Member
    46 Posts

    Re: FORMS_What type of form for TinyMCE editing Link to this post

    thanks for the answer

    I've added

    $fields->addFieldToTab('Root.Content.Main', new HtmlEditorField('Column2', 'Column 2'), 'Left Column');

    but now when I do a db/flush I get

    Fatal error: Class 'HtmlEditor' not found in /home/mysite/domains/mysite.co.nz/public_html/pm/sapphire/core/Object.php on line 36

    I've removed the offending line but now when I try to get the site I just see

    ERROR:
    Error

    The website server has not been able to respond to your request.

    The only solution I can see is to reinstall...

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