3

Is there a way to get my custom TinyMCE button to insert multiple lines of text? Ultimately I am making a "Premade Themes" button where a user will select a theme and it will insert about 6-8 different shortcodes with one click and they can edit the shortcodes accordingly..

A problem I'm having is that all of these shortcodes get put in one line. Here's the code I use that actually pastes the shortcodes:

tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : 'the shortcodes go here'});

Any help is appreciated!

2

This should be as easy as adding <br /> between shortcodes or every time you want to add a new line and also if you are inserting content you should use mceInsertContent instead of mceInsertClipboardContent unless you are actually getting the content from the clipbard, so:

tinyMCEPopup.editor.execCommand('mceInsertContent', false, '<p>[shotcode1]<br/>[shotcode2]<br/>[shotcode3]</p>'));
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.