Add custom icon to tinyMCE button


captis

I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus:

 ed.addButton('youtube', {
     title: 'Add Video' ,
     icon: 'icon-youtube',
     onclick: function () {
     //do stuff here...
 }

Using images like the docs is not acceptable, but for some reason I can't get this to work. Any ideas?

captis

This CSS-based solution seems to work well:

 i.mce-i-[FONT-AWESOME-CLASSNAME]:before {   // FONT-AWESOME-CLASSNAME e.g. "icon-youtube"
    content: "[FONT-AWESOME-CONTENT]";       // FONT-AWESOME-CONTENT e.g. "\f166"
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    text-decoration: inherit;
    color: #000;
    font-size: 1.5em;
    padding-right: 0.5em;
    position: absolute;
    top: 15%;
    left: 0;
 }

It's based on matt-royal 's answer on this stack exchange wordpress thread

Related


Add custom icon to tinyMCE button

captis I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not accep

Add custom icon to tinyMCE button

captiz I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not acceptable,

Add custom icon to tinyMCE button

captis I'm trying to add a Font-Awsome icon to a button I've added to tinyMCE, thus: ed.addButton('youtube', { title: 'Add Video' , icon: 'icon-youtube', onclick: function () { //do stuff here... } Using images like the docs is not accep

Add icon to TinyMCE custom menu

work for life I'm modifying a plugin that adds a custom TinyMCE menu in WP. I need to be able to add icons to dropdown menu items and submenu items. I have icons enabled, which add space to it in the HTML, but can't figure out where JS can put them in. createC

Add icon to TinyMCE custom menu

work for life I'm modifying a plugin that adds a custom TinyMCE menu in WP. I need to be able to add icons to dropdown menu items and submenu items. I have icons enabled, which add space to it in the HTML, but can't figure out where JS can put them in. createC

Add icon to TinyMCE custom menu

work for life I'm modifying a plugin that adds a custom TinyMCE menu in WP. I need to be able to add icons to dropdown menu items and submenu items. I have icons enabled, which add space to it in the HTML, but can't figure out where JS can put them in. createC

Add icon to button with custom style

ehsan toghian I have a button defined as follows: <Button android:id="@+id/fab" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

How to add custom button in ACF Wysiwyg tinymce?

PHP work I need to add custom button to toolbar ACF Wysiwyg tinymce. I use the following code: tinymce.PluginManager.add( 'wdd_mce_format', function ( editor, url ) { editor.addButton( 'wdd_mce_format', { active: true, tooltip: 'Formating t

TinyMCE change existing button icon

Nikolai Prokopyev I am using TinyMCE WYSIWYG editor in HTML forms. I want to change the icons (16x16 images) of existing toolbar buttons, i.e. bold buttons, italic buttons, etc. The idea is to put your own graphics instead of the basic B , I , etc icons. I fou