Reputation: 1
I was trying to add an image plugin to the tiny mce editor . Added the code snippet to my html.erb file, unable to get the functionality on the editor. why is this happening. This is the code that i wrote
<html>
<head>
<script src="//cloud.tinymce.com/stable/tinymce.min.js"></script>
<script>tinymce.init({ selector:'textarea' });</script>
<script>tinymce.init({ selector: "textarea", // change this value according to your HTML plugins: "image", menubar: "insert", toolbar: "image", image_list: [ {title: 'My image 1', value: 'http://www.tinymce.com/my1.gif'}, {title: 'My image 2', value: 'http://www.moxiecode.com/my2.gif'} ] }); </script>
</script> </head> <body> <textarea>Easy! You should check out MoxieManager!</textarea> </body>
</html>
Upvotes: 0
Views: 540
Reputation: 170
From the Full Featured Example on TinyMCE's DOCS. you need thee plugins
parameter.
tinymce.init({
selector: 'textarea',
height: 1000,
menubar: true,
plugins: [
'advlist autolink lists link image charmap print preview anchor textcolor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table contextmenu paste code help wordcount'
],
toolbar: 'insert | undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help',
content_css: [
'../../css/style.css']
});
Upvotes: 1