django-wysiwyg icon indicating copy to clipboard operation
django-wysiwyg copied to clipboard

tinymce 4.0 compatibility

Open jpatel3 opened this issue 10 years ago • 1 comments

It seems like it only works with tinymce 3.0. with 4.0 lot of file names has been changed, which causes issue while using it with 4.0.

any recommendation?

jpatel3 avatar Dec 15 '14 22:12 jpatel3

You can extend django-wysiwyg. In order to do that, you have to create two templates :

  • django_wysiwyg/tinymce4/includes.html
  • django_wysiwyg/tinymce4/editor_instance.html

And then, you change the flavor in your settings :

    DJANGO_WYSIWYG_FLAVOR = 'tinymce4'

You can copy-paste the templates of django_wysiwyg/tinymce or django_wysiwyg/tinymce_advanced and edit the config.

For instance, this is the content of django_wysiwyg/tinymce_advanced/editor_instance.html :

{% extends 'django_wysiwyg/tinymce/editor_instance.html' %}

And the content of django_wysiwyg/tinymce_advanced/includes.html, where you can change the config :

{% extends 'django_wysiwyg/tinymce/includes.html' %}

{% block django_wysiwyg_editor_config %}
    var django_wysiwyg_editor_config = {
        'menubar': false # change the config here
    };
{% endblock %}

At last, if you copy the tinymce flavor files, you must change the src attribute of the first script in order to get the right file. Otherwise, you have to use the development package of TinyMCE and you need to create a link from tiny_mce_src.js to tinymce.js.

ghost avatar Apr 16 '15 15:04 ghost