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

Is the selector config required but not stated in the docs?

Open Nengha-John opened this issue 2 years ago • 1 comments

I have just spent a few hours debugging why my form field did not display any rich text feature in my frontend. I tried several solutions including setting TINYMCE_JS_URL,TINYMCE_JS_ROOT to both CDN values and relative paths but did not work till I used the sample code on the website after viewing this stackoverflow answer which suggested defining a selector for the target elements.

Config that actually works: TINYMCE_DEFAULT_CONFIG = { ".....", "selector": "textarea", "......" }

After setting up the selector config in TINYMCE_DEFAULT_CONFIG, the rich text features are displayed but the docs do not state that. Is that a short coming in the documentations?

Nengha-John avatar Jan 17 '23 14:01 Nengha-John

It is possible that the lack of information on the selector configuration option in the Django TinyMCE documentation is a shortcoming. The selector option is used to specify the CSS selector for the element(s) that you want to apply the TinyMCE editor to.

Without this configuration, the TinyMCE editor may not be applied to the correct element, which could result in the behavior you experienced where the rich text features were not displayed.

some1ataplace avatar Mar 24 '23 20:03 some1ataplace