Jump to content

TinyMCE - Custom Button for inserting a specific template


Sasni

Recommended Posts

I am using Prestashop 1.7.8.5. I have made several templates. Is it possible to prepare a button that will insert the selected template? For example, I have 4 templates and I want to make 4 buttons. the first button inserts the first template. the second button inserts the second template and so on. I tried to use this code in the file \js\admin\tinymce.inc.js but my new button is not displaying :( 

toolbar2: 'customInsertButton',
setup: function (editor) {
	editor.ui.registry.addButton('customInsertButton', {
		text: 'My Button',
		onAction: function (_) {
			editor.insertContent('My button works!'); 
		} 
	});
},

Perhaps Prestashop has some limited version of this editor? I ask because for example it is possible to add templates. but I would like to be able to insert them faster, with one button...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...