Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » tinyMCE in security-tab

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: 1477 Views
  • blaater
    Avatar
    Community Member
    22 Posts

    tinyMCE in security-tab Link to this post

    Hello,

    Can anybody help me? I'm trying to get a textarea with tinyMCE in the security tab. To do this i've made a adjustment in the SecurityAdmin class. I've added a HtmlEditorField to the fieldset in the getEditForm function. The textarea is visible and the content is saved to the database, but there's no tinyMCE visible. Has anybody done this before? Is there a tutorial for this?

    Thanks in advance!

  • Re: tinyMCE in security-tab Link to this post

    Hi blaater,

    As the security area is not designed to use TinyMCE, you'll need to hack some of this files in the cms/ directory to achieve this. If you examine cms/templates/Includes/, SecurityAdmin_right.ss and CMSMain_right.ss, youll notice the tag

    <% include Editor_toolbar %>


    in CMSMain_right.ss

    If you put this right at the top of SecurityAdmin_right.ss, hopefully it'll work. I haven't tested this, but from what I can tell that should include all the needed javascript etc as well.

  • blaater
    Avatar
    Community Member
    22 Posts

    Re: tinyMCE in security-tab Link to this post

    Thanks for the help. Once I added the editor toolbar in the template, tinymce was visible , but it still didn't work. Then I also copied the following code from the init of CMSMain.php to the in it of SecurityAdmin.php and everything works fine.

    // We don't want this showing up in every ajax-response, it should always be present in a CMS-environment
          if(!Director::is_ajax()) {
             Requirements::javascriptTemplate("cms/javascript/tinymce.template.js", array(
                "ContentCSS" => (SSViewer::current_theme() ? "themes/" . SSViewer::current_theme() : project()) . "/css/editor.css",
                "BaseURL" => Director::absoluteBaseURL(),
                "Lang" => i18n::get_tinymce_lang()
             ));
          }

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