Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » SimpleHTMLEditorField

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1186 Views
  • hunman
    Avatar
    Community Member
    18 Posts

    SimpleHTMLEditorField Link to this post

    Hello,

    I have created a new admin module and I am using SimpleHTMLEditorField in the form like this:

    function getEditForm($id) {
          
          $validator = new RequiredFields('article_name', 'article_date','article_content');   
             
          // Create form fields
          $fields = new FieldSet(
             // TODO The ID field needs to be hidden but while testing make it readonly
             new ReadonlyField('ID','id #',$id),
             new TextField('article_name', "Article Name", ""),
             $dateField = new DateField('article_date', "Article Date", ""),
             new CheckboxField('article_publish',"Publish",""),
             new CheckboxField('article_archive',"Archive",""),
             new SimpleHTMLEditorField('article_content', "Content")
             
             
             
          );

    The SimpleHTMLEditorField shows when the form loads normally, but it does not show when the form loaded using ajax on the right area of admin panel.

    How can I get the SimpleHTMLEditorField working in Ajax form ? Please Help ?

    Thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: SimpleHTMLEditorField Link to this post

    I think you would need to load jquery.livequery.js and change the JS function that loads SimpleHTMLEditor field to use a livequery handler..

  • hunman
    Avatar
    Community Member
    18 Posts

    Re: SimpleHTMLEditorField Link to this post

    Thanks UncleCheese.

    How should I change the JS function to, that loads SimpleHTMLEditorField ?

    Also, I want to show HTML editor similar to the one being used in the CMS admin, how can I include all those options in SimpleHTMLEditorField ?

  • UncleCheese
    Avatar
    4085 Posts

    Re: SimpleHTMLEditorField Link to this post

    You're not going to be able to do that. That instance of TinyMCE has been heavily customised and pretty well baked into CMSMain.

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