Jump to:

7939 Posts in 1472 Topics by 944 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: 3649 Views
  • UncleCheese
    Avatar
    4085 Posts
  • George
    Avatar
    Community Member
    41 Posts

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

    Hello UncleCheese

    I get a PHP Error:
    PHP Fatal error: Call to undefined method SimpleTinyMCEField::set_buttons() in .../dataobject_manager/_config.php

  • UncleCheese
    Avatar
    4085 Posts

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

    Sorry, that should say "set_default_buttons"

  • LesC
    Avatar
    Community Member
    70 Posts

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

    Thanks for this update UncleCheese,

    Do you know what the allowed buttons are for the SimpleTinyMCEField? Should we be able to use the normal TinyMCE buttons like Paste Text?

    Every installation should have Paste Text, or Paste Word enabled, as the normal paste function goes mental with content from Word - especially seeing as my clients all write stuff in Word first!

    Cheers

    L

  • UncleCheese
    Avatar
    4085 Posts

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

    Yeah, I haven't documented it yet, but what you want to do is go into your _config.php and use:

    SimpleTinyMCEField::set_default_buttons(array(
    'button1row1,button2row1,|,button3row1',
    'button1row2,button2row2,|,button3row2',
    etc...
    ));

    Where a | is a separator.

    I think I have a list of options here.. let me see.

    "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,
    styleselect,formatselect,fontselect,fontsizeselect",

    "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,
    undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",

    "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,
    print,|,ltr,rtl,|,fullscreen",

    "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,
    visualchars,nonbreaking,template,pagebreak"

    That oughta get you started.

  • LesC
    Avatar
    Community Member
    70 Posts

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

    Thanks for the uber quick reply!

    I can't seem to get the pastetext and pasteword options to show unfortunately

    Do they work for you?

    L

  • Shawn Parr
    Avatar
    Community Member
    60 Posts

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

    The Paste Text and Paste Word are also not working on my test system right now.

    I have no idea, but I hope to have some time in the next few weeks to look at it, but do you think that it might be possible to get the TinyMCE link tool to work in some way like it does directly in the CMS? Maybe the pop up window can have a drop down for pages on the site, and the fields like the control panel? I think that would be killer, but I don't know enough about the backside of sapphire/cms yet to know if it is even doable.

  • 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
    so it will look like this:

    private static $default_plugins = "safari,paste";

    next You have to add pastetext 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.

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