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

Premium Plugins Not Enabled #8

Open
Scoffins opened this issue Jul 17, 2024 · 5 comments
Open

Premium Plugins Not Enabled #8

Scoffins opened this issue Jul 17, 2024 · 5 comments

Comments

@Scoffins
Copy link

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?

@GamerGirlandCo
Copy link
Owner

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.

@Scoffins
Copy link
Author

Scoffins commented Jul 21, 2024

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.

@GamerGirlandCo
Copy link
Owner

GamerGirlandCo commented Jul 30, 2024

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"
})

@Scoffins
Copy link
Author

Scoffins commented Jul 30, 2024

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",
    
});`

@Scoffins
Copy link
Author

Scoffins commented Jul 30, 2024

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.

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