2

i have element

<h2 id="editable" class="editable">Editable header</h2>

i tried to use

<script>
   require([
    'jquery',
    'tinymce'

    ],function($){
        tinyMCE.init({
              elements: 'div.editable',
              inline: true,
              toolbar: 'undo redo',
              menubar: false
        });
})
</script>
5
  • please let me know if you have any issue Commented Nov 11, 2016 at 12:03
  • yep. I follow this code you share. It work, but not show toolbar!
    – xanka
    Commented Nov 13, 2016 at 6:46
  • Have you remove var and clear cache Commented Nov 13, 2016 at 6:47
  • i has flush and clean cache.
    – xanka
    Commented Nov 13, 2016 at 7:35
  • Please check more details in core module of magento, how to use this toolbar. Commented Nov 13, 2016 at 7:38

2 Answers 2

3

You are forgot to pass tinyMCE parameter in function.

Try below code :

<script>
   require([
    'jquery',
    'tinymce'

    ],function($,tinyMCE){
        tinyMCE.init({
              elements: 'div.editable',
              inline: true,
              toolbar: 'undo redo',
              menubar: false
        });
})
</script>

Also please clear the cache and after clearing the cache use below command.

php bin/magento setup:static-content:deploy
1

You have missing tinyMCE in function parameter.

<script>
   require([
    'jquery',
    'tinymce'

    ],function($,tinyMCE){
        tinyMCE.init({
              elements: 'div.editable',
              inline: true,
              toolbar: 'undo redo',
              menubar: false
        });
})
</script>

Remove var folder and clear cache and try again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.