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

DOM and TinyMCE


Reply


6 Posts   1534 Views

Avatar
sca123

Community Member, 61 Posts

1 August 2009 at 3:14am

Does anyone know of a way of getting TinyMCE working in the popup DOM window. I am using HTMLEditorField which is just displaying a standard textarea with no toolbar.

Thanks

Avatar
UncleCheese

Forum Moderator, 4094 Posts

1 August 2009 at 3:35am

Use SimpleWysiwygField. http://doc.silverstripe.org/doku.php?id=simplewysiwygfield

Avatar
sca123

Community Member, 61 Posts

1 August 2009 at 7:57am

Thank you - but I could do with a little more help with integration of this into my existing code. This field is to replace the existing TextAreaField - Description:

<?php
class InfoBox extends DataObject
{
   static $db = array (
      'Title' => 'Text',
      'Description' => 'Text',
      'Link' => 'Text'
   );

   static $has_one = array (
      'HomePage' => 'HomePage',
      'MultiBox' => 'MultiBox',
      'DropDown' => 'DropDown',
      'Image' => 'Image'
   );

   public function getCMSFields_forPopup()
   {
      return new FieldSet(
         new TextField('Title'),
         new TextAreaField('Description'),
         new TextField('Link'),
         new ImageField('Image')
      );
   }

}
?>

Avatar
UncleCheese

Forum Moderator, 4094 Posts

3 August 2009 at 11:43am

There's an example right in the documentation I sent you. It should be as easy as replacing TextareaField with SImpleWysiwygField, and you can customize from there if you want.

Avatar
sca123

Community Member, 61 Posts

4 August 2009 at 9:58am

I did try this but got the error message: Fatal error: Class 'SimpleWysiwygField' not found

Avatar
UncleCheese

Forum Moderator, 4094 Posts

4 August 2009 at 12:26pm

When did you last run an update? It's been in the package for a while now.