Alimon Karim
Alimon Karim

Reputation: 4469

How to add multiple plugin in tinymce?

I have tried this simple code for try tinyMCE.It is working fine.Here the problem is when I am trying to add multiple plugin it is not working.Here I have used tinymce CDN.Here is the code

<!DOCTYPE html>
<html>
<head>
<script src="http://tinymce.cachefly.net/4.0/tinymce.min.js"></script>

<script>
        tinymce.init({selector:'textarea',
        plugins: "code",
        plugins: "image"
        });
</script>


</head>
<body>
        <textarea></textarea>
</body>
</html>

Here code plugin is working but image plugin not working.If I remove code plugin than image plugin working.How can I apply both plugin?

Upvotes: 11

Views: 15910

Answers (3)

SOLOMON SHALOM LIJO
SOLOMON SHALOM LIJO

Reputation: 1

You can add multiple plugins using two methods - space or array. Let's look into the array method -

<script>
tinymce.init({selector:'textarea',
plugins: ["code", "image"]
});
</script>

Now, the space method would be -

<script>
        tinymce.init({selector:'textarea',
        plugins: "code image"
        });
</script>

Upvotes: 0

tngeene
tngeene

Reputation: 390

You only need to separate the plugins with a space. in your case, it would be:

<script>
    tinymce.init({selector:'textarea',
    plugins: "code image",
    });

Upvotes: 1

dmullings
dmullings

Reputation: 7200

You are specifying the plugins property twice. It should only be there once and then multiple plugins should be specified in that property. According to the documentation you need to be using a comma or space separated string, or an array of strings. Try this below:

<script>
        tinymce.init({selector:'textarea',
        plugins: "code image"
        });
</script>

https://www.tinymce.com/docs/configure/integration-and-setup/#plugins

Upvotes: 23

Related Questions