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>
  • please let me know if you have any issue – Rakesh Jesadiya Nov 11 '16 at 12:03
  • yep. I follow this code you share. It work, but not show toolbar! – xanka Nov 13 '16 at 6:46
  • Have you remove var and clear cache – Rakesh Jesadiya Nov 13 '16 at 6:47
  • i has flush and clean cache. – xanka Nov 13 '16 at 7:35
  • Please check more details in core module of magento, how to use this toolbar. – Rakesh Jesadiya Nov 13 '16 at 7:38
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, privacy policy and cookie policy

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