Hi Charlie,

1. First thing first, here's how to add the 'source' button on a single 
rich-text field, e.g. for the "tour" body on the Magnolia demo.

Here's the RichTextFieldDefinition:
https://demo.magnolia-cms.com/.magnolia/admincentral#app:configuration:browser;/modules/tours/apps/tours/subApps/detail/editor/form/tabs/tour/fields/body:treeview:

Now add a 'source' property to that node and set its value to 'true', as stated 
on the documentation 
https://documentation.magnolia-cms.com/display/DOCS/Rich+text+field

Check the change by going to the Tours app (where that dialog definition we 
just edited is used), scroll down and you'll notice the source button on the 
CKEditor.
https://demo.magnolia-cms.com/.magnolia/admincentral#app:tours:detail;/magnolia-travels/Kyoto:edit

2. So far so good. Again, if you only need the 'source' button, no need for a 
config.js file. Mind that however, if you need more CKEditor customization 
through such a JS file, it won't figure out itself which file to use, you 
*also* have to configure it, through the 'configJsFile' property this time.

3. Now, here's how to apply this configuration to *all* rich-text fields on 
your instance.
There is no "master" definition, but there's a FieldFactory which is in charge 
of reading the definitions from config, and producing the field, i.e. a 
CKEditor (through the Vaadin wrapper, for that matter).
You'll find the field definition-factory mappings in config e.g. at 
/modules/ui-framework/fieldTypes/textArea
Extend that (RichText)FieldFactory configured in there, you should be able to 
do something like this:

[code]@Override
protected MagnoliaRichTextFieldConfig initializeCKEditorConfig() {
    MagnoliaRichTextFieldConfig config = super.initializeCKEditorConfig();
    config.addToExtraPlugins("sourcearea");
    return config;
}[/code]

Cheers,
Mika

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=c7c64314-5a37-408d-b1fb-478ff6efda62


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to