Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Nengha-John opened this issue Jan 17, 2023 · 1 comment
Open

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

Nengha-John opened this issue Jan 17, 2023 · 1 comment

Comments

@Nengha-John
Copy link

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?

@some1ataplace
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants