How do I add buttons to the tinymce editor when used on case description?

Hi I have amended the description field on a case so it supports HTML and the tinymce editor via adding the file \custom\Extension\modules\Cases\Ext\Vardefs\sym_descript_rich.php

<?PHP
$dictionary['Case']['fields']['description']['type'] = 'htmleditable_tinymce';
$dictionary['Case']['fields']['description']['dbType'] = 'longtext';

shot of descript field in cases


This works nicely but would be better if it had some of the same characteristics as the description box in the Knowledgebase article - namely
1. Larger Field height - ideally resizable (works the same way as the KB
2. the Button for inserting a hyperlink
3. the toolbar button for inserting a picture.

4. A "nice to have" would be the Clear formatting button.

Descript box in KB

Any help would be welcome.

Regards

Greg Mackey

  • Hi Greg, 

    A way to enhance your field could be to copy the same approach that is being used on the #KBContents module. 

    You can see that the htmleditable_tinymce is being enhanced in the following file: 

    SugarRoot/modules/KBContents/clients/base/fields/htmleditable_tinymce/htmleditable_tinymce.js

    ({
        extendsFrom: 'Htmleditable_tinymceField',

        /**
         * Flag indicates, should we disable field.
         * @property {boolean}
         */

        shouldDisable: null,

        /**
         * KB specific parameters.
         * @private
         */

        _tinyMCEConfig: {
            'height': '300',
            'plugins': 'code,textcolor,link,image',
            'toolbar': 'code | bold italic underline strikethrough | bullist numlist | ' +
            'alignleft aligncenter alignright alignjustify | forecolor backcolor | ' +
            'removeformat | image link | fontsizeselect formatselect'
        },

    You could try to replicate this approach on the cases module to have a similar editor. 

    I hope this helps. 

  • Hi Andre, 

    That worked exactly as needed... I copied the file 

    SugarRoot/modules/KBContents/clients/base/fields/htmleditable_tinymce/htmleditable_tinymce.js

    to a custom folder as follows:
    SugarRoot/custom/modules/Cases/clients/base/fields/htmleditable_tinymce/htmleditable_tinymce.js

    Then QRR

    and I had the correct Toolbar in the cases editor.