Вот код, который вам понадобится.Кроме того, вам нужно будет выбрать значок и добавить имя кнопки в конфигурацию кнопки в init-файле tinymce (theme_advanced_buttons1: 'your_button_name, save, table,...'
).
// Register example button
ed.addButton('example', {
title : 'name:[cf]name[/cf]',
image : '../jscripts/tiny_mce/plugins/example/img/example.gif',
onclick : function() {
//ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format : 'text'}));
var content = '<div class ="template1"><img src="" /><span><b>name:[cf]name[/cf] </b><span></div>';
ed.execCommand('mceInsertContent', false, content);
}
});