Open Scoffins opened 1 month ago
could you show me the code you're using to load the plugins? make sure you're not loading tinymce via the cloud or the official npm package.
Basically I load the script like so:
<script src="/tinymce/tinymce.min.js"></script>
Then initialize it like this:
tinymce.init({
selector: '#tiny',
license_key: 'gpl',
schema: 'html5',
plugins: 'advcode',
toolbar: 'code',
table_toolbar: '',
statusbar: false,
branding: false,
promotion: false,
relative_urls : false,
convert_urls : true,
});
That's a simplified stripped down code, but I'm using a more complex version in production. I'm currently using the free version hence the GPL license, but I tried many things to get your script working properly and nothing worked. I tried GPL license, no license, even signed up for an API code, nothing worked. I only tried with advcode plugin from your premium script, but it didn't work. The editor does load, but when I try to use premium plugins it keeps showing that error message in a little orange banner.
I've seen others here saying it works great and thanking you, so I'm assuming I'm doing something wrong, but I can't for the life of me figure out what. It's not a caching issue either.
Thanks for getting back to me.
Basically I load the script like so:
<script src="/tinymce/tinymce.min.js"></script>
Then initialize it like this:
tinymce.init({ selector: '#tiny', license_key: 'gpl', schema: 'html5', plugins: 'advcode', toolbar: 'code', table_toolbar: '', statusbar: false, branding: false, promotion: false, relative_urls : false, convert_urls : true, });
That's a simplified stripped down code, but I'm using a more complex version in production. I'm currently using the free version hence the GPL license, but I tried many things to get your script working properly and nothing worked. I tried GPL license, no license, even signed up for an API code, nothing worked. I only tried with advcode plugin from your premium script, but it didn't work. The editor does load, but when I try to use premium plugins it keeps showing that error message in a little orange banner.
I've seen others here saying it works great and thanking you, so I'm assuming I'm doing something wrong, but I can't for the life of me figure out what. It's not a caching issue either.
Thanks for getting back to me.
sorry for the late response!
you have to use external_plugins
and base_url
here's a helper i wrote to convert a plugin array/string into an external_plugins
object.
const reducer = (pv, cv) => {
return { ...pv, [cv]: `plugins/${cv}/plugin.min.js` };
};
// use the reducer in your config
tinymce.init({
//...
external_plugins: "advcode".split(" ").reduce(reducer),
base_url: "/tinymce"
})
Thanks but it just doesn't work. It's trying to load files which don't exist such as customeditor.min.js and codemirror.min.js, and throwing loads of errors.
`
tinymce.init({
selector: 'textarea#tiny',
license_key: 'gpl',
schema: 'html5',
plugins: 'advcode',
toolbar: 'code',
table_toolbar: '',
statusbar: false,
branding: false,
promotion: false,
relative_urls : false,
remove_script_host : false,
convert_urls : true,
min_height: 400,
external_plugins: "advcode".split(" ").reduce(reducer),
base_url: "/static/tinymce2",
});`
I fixd it (mostly - must be inline-mode to work) by ripping customeditor.min.js and codemirror.min.js from TinyMCE CDN. Happy to report it's working, along with other premium plugins such as the image editor, and merge tags.
This is a very valuable resource and I want to thank you for your hard work. I know this stuff can sometimes be a thankless job but please know that it is deeply appreciated by some.
When I try to load premium plugins using this script it just says that premium plugins aren't enabled for my API and to upgrade. Am I missing something?