There doesn't appear to be a "nice" way to do this right now. Even the Plone docs are currently at a loss. http://docs.plone.org/develop/plone/forms/wysiwyg.html#id9
The problem lies with Products.TinyMCE trying to get the WYSIWYG configuration from the widget attribute of the Field.
https://github.com/plone/Products.TinyMCE/blob/1.3.6/Products/TinyMCE/utility.py#L711-L713
# Get widget attributes
widget = getattr(field, 'widget', None)
filter_buttons = getattr(widget, 'filter_buttons', None)
allow_buttons = getattr(widget, 'allow_buttons', None)
But, as I understand, with Dexterity we instead map fields to widgets on the form object.
from plone.autoform import directives as form
from plone.app.z3cform.wysiwyg import WysiwygFieldWidget
class IExample(model.schema):
form.widget('body', WysiwygFieldWidget)
body = schema.Text(title=u"Body")
So, our body field possesses no widget attribute from which Products.TinyMCE can extract configurations.
At any rate, if you need it to work right now, I was able to hack it by doing the following:
In your ZMI, customize portal_skins/tinymce/tinymce_wysiwyg_support to change the line field field|nothing
to field field|view/field|nothing
.
Define your content type in a schema-driven fashion, and for your WYSIWYG field do the following:
class mywidg(object):
allow_buttons = ('bold',
'italic',
'justifyright',
'justifyleft',)
class IExample(model.schema):
form.widget('body', WysiwygFieldWidget)
body = schema.Text(title=u"Body")
body.widget = mywidg()