StevenDevooght / tinyMCE-mention

Mention/Autocomplete plugin for tinyMCE WYSIWYG editor.
http://stevendevooght.github.io/tinyMCE-mention/
221 stars 97 forks source link

Configuration - not an issue, just a question #54

Closed PaulMarclay closed 7 years ago

PaulMarclay commented 7 years ago

I've installed this plugin using npm install, but I'm not sure about how should I tell to TinyMCE from where it must load it.

I'm using it in a rails application.

I have installed TinyMCE from its CDN

= javascript_include_tag '//cdn.tinymce.com/4/tinymce.min.js'

and I have initialized it on this way:

tinymce.init({
      selector: '.tinymce',
      theme: 'modern',
      theme_url: ''
      plugins: [
          'advlist autolink lists link image charmap print preview hr anchor pagebreak',
          'searchreplace wordcount visualblocks visualchars code fullscreen',
          'insertdatetime media nonbreaking save table contextmenu directionality',
          'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc mention'
      ],
      toolbar1: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
      toolbar2: 'print preview media | forecolor backcolor emoticons | codesample',
      image_advtab: true,
      templates: [
          { title: 'Test template 1', content: 'Test 1' },
          { title: 'Test template 2', content: 'Test 2' }
      ],
      content_css: [
          '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
          '//www.tinymce.com/css/codepen.min.css'
      ],
      mentions: {
          source: [
              { name: 'Tyra Porcelli' },
              { name: 'Brigid Reddish' },
              { name: 'Ashely Buckler' },
              { name: 'Teddy Whelan' }
          ]
      }
  });

Do you know how should I tell to TinyMCE to use your plugin without changing the base url configuration?

Thanks! Paul.

StevenDevooght commented 7 years ago

Hi,

Normally you just have to copy the plugin to the plugins folder of the tinymce installation.

Alternatively you can use the the external_plugins option. An example can be found here.

I don't have experience with ruby on rails, but maybe this gem can help?

PaulMarclay commented 7 years ago

Hi Steven,

it worked very well using the external_plugins option. Many thanks for your quick response, I appreciate it.

Cheers.