Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » New Features! Nested DataObjectManager, SimpleTinyMCEField

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 3847 Views
  • batata
    Avatar
    Community Member
    10 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    Solution for pastetext and pasteword:

    edit dataobject_manager\code\simple_tinymce_field\SimpleTinyMCEField.php

    and add paste plugin in 6th line

    private static $default_plugins = "safari,paste";

    so it will look like this

    next You have to add patetext or/and pasteword in your _config.php or $default_buttons
    additionaly You can add

    paste_auto_cleanup_on_paste : true,
    paste_remove_spans: true,
    paste_remove_styles: true,

    in buildJS() function in SimpleTinyMCEField.php so it will remove some unnessecary code during paste.

  • batata
    Avatar
    Community Member
    10 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    Solution for pastetext and pasteword:

    edit dataobject_manager\code\simple_tinymce_field\SimpleTinyMCEField.php

    and add paste plugin in 6th line

    private static $default_plugins = "safari,paste";

    so it will look like this

    next You have to add patetext or/and pasteword in your _config.php or $default_buttons
    additionaly You can add

    paste_auto_cleanup_on_paste : true,
    paste_remove_spans: true,
    paste_remove_styles: true,

    in buildJS() function in SimpleTinyMCEField.php so it will remove some unnessecary code during paste.

  • Andrew Houle
    Avatar
    Community Member
    132 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    Nice fix, thanks for that. It would be good to see this implemented in the next Rev of DOM so that I don't have to hack the core files.

  • UncleCheese
    Avatar
    4085 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    I've rolled in this change. Thanks, batata!!

  • martinluff
    Avatar
    Community Member
    4 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    I'm probably missing something here but when I output the placeholder for a field using SimpleTinyMCEField in my template the HTML is being encoded - is there a method for formatting the output unencoded or do I need to be using something else...

    Still early days for me with SilverStripe so feeling my way around... thanks in advance for any help

  • UncleCheese
    Avatar
    4085 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    Make sure you cast the field as HTMLText.

  • martinluff
    Avatar
    Community Member
    4 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    Ahhhh... of course! Thanks - sorry for silly question.

  • edski
    Avatar
    Community Member
    12 Posts

    Re: New Features! Nested DataObjectManager, SimpleTinyMCEField Link to this post

    I'm having problems getting the tablecontrols to show up. I have this in my _config.php

    SimpleTinyMCEField::set_default_buttons(array(
    'bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,styleselect,formatselect',
    'cut,copy,paste,pastetext,pasteword,|,bullist,numlist,charmap|,link,unlink,anchor,image,|,code',
       'tablecontrols'

    ));   

    I end up with 4 separators on the third line of the editor buttons, but there are not table buttons there. Any ideas?

    ***Worked it out (guessed!)***
    Add this to _config.php
    SimpleTinyMCEField::set_default_plugins("safari,paste,table");

    3847 Views
Page: 1 2
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.