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.

createControl:function(d,e){if(d=="ss_button"){d=e.createMenuButton("ss_button",{title:"SS Shortcodes",image:"../wp-content/plugins/ss-shorts/js/images/shortcodes.png",icons:true});var a=this;

d.onRenderMenu.add(function(c,b){
b.addSeparator();c=b.addMenu({image:"../wp-content/plugins/ss-shorts/js/images/uparrow.png",title:" Arrows"});
a.addImmediate(c,"Right Arrow","[rightarrow]");
a.addImmediate(c,"Left Arrow","[leftarrow]");
a.addImmediate(c,"Up Arrow","[uparrow]");
a.addImmediate(c,"Down Arrow","[downarrow]");
b.addSeparator();

Adding an image before or after the menu item title: doesn't work, neither does "icon:". The icon is initially set to false in the first part. I set it to true which leaves room for the icon. Just can't figure out how to get them in there.

work for life

I realized that I can use the menu item class to add the icon as a background image. Elegant, yet powerful.

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

How to add custom image/icon in ANTD design menu?

Johnny Shruder Using this example : https://ant.design/components/layout/#components-layout-demo-side How to add custom image or icon instead of default icon. I tried: <Menu.Item to="/" key="2"> <img className="ant-menu-item" src={require('image.png')} />

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,

How to add custom block in tinyMce

Tariq Hussein I want to add a custom format block for TinyMCE, I was able to do it using the following code. style_formats: [ {title : 'Code', block : 'pre', classes : 'pre-code', exact: true},] https://codepen.io/anon/pen/vWRGEg However, by adding this code,

How to add custom block in tinyMce

Tariq Hussein I want to add a custom format block for TinyMCE, I was able to do it using the following code. style_formats: [ {title : 'Code', block : 'pre', classes : 'pre-code', exact: true},] https://codepen.io/anon/pen/vWRGEg However, by adding this code,

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

How to add custom image/icon in ANTD design menu?

Johnny Shruder Using this example : https://ant.design/components/layout/#components-layout-demo-side How to add custom image or icon instead of default icon. I tried: <Menu.Item to="/" key="2"> <img className="ant-menu-item" src={require('image.png')} />

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 Custom Buttons to TinyMCE in WordPress

John Smith I want to add a new button with a popup to TinyMCE. But I never see the button. I may be doing something wrong with this modification. How can I insert a new button on that TinyMCE code? I have this TinyMCE code to display in Wordpress frontend:

Add custom icon for bloat menu

Silicon 8 I'm trying to add an icon to a menu (because it looks boring) my menu xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_about" android:orderInCategory="200" android:showA

How to add custom bullets to tinyMCE?

Ennio I would like to add some extra options to the bullet dropdown in tinyMCE, is this possible? I would like to add ►Bullet type and different color options. (red, blue, etc...) username Yes. In the tinyMCE configuration you need to specify: style_formats: [

Tinymce shortcut to add custom styles

cache In my tinymce initialization I use a pre-defined style style_formats : [ {title : 'Date', inline : 'span', classes : 'date'}, {title : 'Trend UP', inline : 'span', classes : 'trend_up'}, {title : 'Trend DOWN', inline : 'span', classes : 'tre

Tinymce shortcut to add custom styles

cache In my tinymce initialization I use a pre-defined style style_formats : [ {title : 'Date', inline : 'span', classes : 'date'}, {title : 'Trend UP', inline : 'span', classes : 'trend_up'}, {title : 'Trend DOWN', inline : 'span', classes : 'tre

How to add custom bullets to tinyMCE?

Ennio I would like to add some extra options to the bullet dropdown in tinyMCE, is this possible? I would like to add ►Bullet type and different color options. (red, blue, etc...) username Yes. In the tinyMCE configuration you need to specify: style_formats: [

Add custom html and css in TinyMCE

shooter I'm using TinyMCE and I want to add custom html/css to the output. All bulleted lists created in the Tiny editor should have these css classes and a tag like <i>this : <ul class="iconlist"> <li><i class="icon-double-angle-right"></i> Item 1</li>

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

How to add custom image/icon in ANTD design menu?

Johnny Shruder Using this example : https://ant.design/components/layout/#components-layout-demo-side How to add custom image or icon instead of default icon. I tried: <Menu.Item to="/" key="2"> <img className="ant-menu-item" src={require('image.png')} />

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

Tinymce shortcut to add custom styles

cache In my tinymce initialization I use a pre-defined style style_formats : [ {title : 'Date', inline : 'span', classes : 'date'}, {title : 'Trend UP', inline : 'span', classes : 'trend_up'}, {title : 'Trend DOWN', inline : 'span', classes : 'tre

Add custom icon for bloat menu

Silicon 8 I'm trying to add an icon to a menu (because it looks boring) my menu xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_about" android:orderInCategory="200" android:showA