Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

3705 Posts in 469 Topics by 369 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » SimpleHTMLEditorField in ModelAdmin?

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: UncleCheese

Page: 1
Go to End
Author Topic: SimpleHTMLEditorField in ModelAdmin? 571 Views
  • micahsheets
    avatar
    Community Member
    130 posts

    SimpleHTMLEditorField in ModelAdmin? Link to this post

    I may be trying to push SilverStipe way beyond it's intended purpose, but it is too late for me to go back now.

    One thing I need to do is have an HTMLEditor on a DataObject I am managing with ModelAdmin. The normal HTMLEditorField has problems that SS don't seem to be in a hurry to fix. So I thought that maybe a workaround would be to use SimpleHTMLEditorField. So in my DataObject getCMSFields I replaced the HTMLEditorField with SimpleHTMLEditorField but while the normal one works some of the time the jwywiswg editor doesn't show up at all.

    I have the newest DataObjectManager code installed on SS 2.3.2.

    Is it possible that the problem that plagues tinymce in ModelAdmin also is the problem with the jwywiswg editor?

  • SmartPlugsDesign
    avatar
    Community Member
    57 posts

    Re: SimpleHTMLEditorField in ModelAdmin (possible FIX) Link to this post

    I ran into the same problem for two client sites at the same time... so I really needed a fix for this. I realize that SS is not actively pursuing supporting HTMLEditorFields in ModelAdmin... but it sure would be a nice addition.

    In ModelAdmin.js, around line 187 in 2.3.2... you'll see the form vars. Put the following line in before posting the data to save:

    $('#right form textarea').each(function(){
       tinyMCE.execCommand('mceRemoveControl', false, $(this).attr('id'));
    });

    Hope it helps! Let me know how it works out for you.

    John

  • SmartPlugsDesign
    avatar
    Community Member
    57 posts

    Re: SimpleHTMLEditorField in ModelAdmin? Link to this post

    I ended up adding a few more iterations of the previously mentioned code block in ModelAdmin.js:

    * In the function around line 81 before $('ModelAdminPanel').load() is called
    * At the start of both the goBack and goForward functions

    571 Views
Page: 1
Go to Top

Currently Online: There is nobody online.

Welcome to our latest member: Newclear

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

Comments on this website? Please give feedback.