Sample file and tinyMCE.init Solved

User's avatar
William M.
16:03 Apr 24, 2015
Hi,
I bought custom_templates (tiny mce 4)

I need to add the array config.doksoft_custom_templates

Where i need add? At tinyMCE.init ?

Could you, please, give me one example? I tried to add but o got an error.

Regards,
Bill
Support team avatar
JS+
17:09 Apr 24, 2015
Hello,
Yes, insert configuration in initialization script. Here you can find the sample: http://doksoft.com/soft/tinymce-custom-templates/customize.html
User's avatar
William M.
09:05 Apr 26, 2015
Thanks for the fast answer. I did it but the editor fail to initialize.
Below my source:
<script type="text/javascript">
tinymce.init({
    selector: "textarea",
    plugins: "doksoft_custom_templates",
    toolbar: 'doksoft_custom_templates',
    config.doksoft_custom_templates = [
[
'<img src="path/to/your/image.png"/>',
'<div>some code</div>',
'html'
],
[
'<div>Text template</div>',
'Text for insertion',
'text'
]
];
 });
</script>
User's avatar
William M.
11:22 Apr 28, 2015
Any news?
User's avatar
William M.
08:25 Apr 29, 2015
Could you, please, give me one example of init script with that array into?
The editor fail to initialize if i put the array like i said 26 april.
Thanks
Support team avatar
JS+
08:23 May 03, 2015
You have two JS syntax mistakes in your code. Correct code:
<script type="text/javascript"> 
tinymce.init({ 
selector: "textarea", 
plugins: "doksoft_custom_templates", 
toolbar: 'doksoft_custom_templates', 
config.doksoft_custom_templates: [ 
[ 
'<img src="path/to/your/image.png"/>', 
'<div>some code</div>', 
'html' 
], 
[ 
'<div>Text template</div>', 
'Text for insertion', 
'text' 
] 
]
}); 
</script>