Shinu Thomas
Shinu Thomas

Reputation: 5316

Adding Custom button to tinymce editor

when we giving hyperlink to a text <a> tag will automatically assigned to the text.Like that how i can giving my own tag to the text.So i need a button the toolbar and when i selecting that button a custom tag will automatically added to the selected text.

Upvotes: 1

Views: 665

Answers (2)

Shinu Thomas
Shinu Thomas

Reputation: 5316

theme_advanced_buttons1 : "Tittle,phpimage,bold,italic,underline",    
setup : function(ed) {
            // Add a custom button
            ed.addButton('Tittle', {
                title : 'Tittle',
                image : './images/copy.jpg',
                onclick : function() {
                    // Add you own code to execute something on click
                    ed.focus();
                    ed.selection.setContent('<tittle>' + ed.selection.getContent() + '</tittle>');
                }
            });
        }

Upvotes: 0

Related Questions