Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

New Features! Nested DataObjectManager, SimpleTinyMCEField


Go to End
Reply


16 Posts   3929 Views

Avatar
batata

Community Member, 10 Posts

21 November 2009 at 4:56am

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.

Avatar
batata

Community Member, 10 Posts

21 November 2009 at 4:57am

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.

Avatar
Andrew Houle

Community Member, 132 Posts

2 December 2009 at 9:28am

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.

Avatar
UncleCheese

Forum Moderator, 4094 Posts

2 December 2009 at 10:28am

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

Avatar
martinluff

Community Member, 4 Posts

16 July 2010 at 11:07am

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 :-)

Avatar
UncleCheese

Forum Moderator, 4094 Posts

16 July 2010 at 11:16am

Make sure you cast the field as HTMLText.

Avatar
martinluff

Community Member, 4 Posts

16 July 2010 at 5:57pm

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

Avatar
edski

Community Member, 12 Posts

18 October 2011 at 11:39pm

Edited: 18/10/2011 11:46pm

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");

Go to Top