Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3620058
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:57:24+00:00 2026-05-18T22:57:24+00:00

How to add item in contextmenu of tinymce. I need to open a thickbox

  • 0

How to add item in contextmenu of tinymce. I need to open a thickbox from contextmenu selection of tinymce

    var url = "upload.php?keepThis=true&TB_iframe=1&width=1000&height=400&model=true";
    tb_show("Edit Image", url);

I can call thickbox with above codes. Where i need to recode in contextmenu plugin. Help me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:57:25+00:00Added an answer on May 18, 2026 at 10:57 pm

    Ok, in that case you need to load the contextmenu plugin (do this before you load your custom plugin!)

    plugins: '...,contextmenu,....,customcontextmenu,...',
    

    Here is the full sample code for an own contextmenu plugin. You need to have this code inside a file called ‘editor_plugin.js’ (and a file called ‘editor_plugin_src.js’) in a subdirectory named ‘contextmenu’ of the plugins directory.

    (function() {
    
      tinymce.PluginManager.requireLangPack('customcontextmenu');
    
      tinymce.create('tinymce.plugins.customcontextmenu', {
    
        init : function(ed, url) {
            ed.addCommand('custom_option', function() {
                // do what you want here!!!
            });
    
    // we need the real contextmenu in order to make this work
    if (ed && ed.plugins.contextmenu) {
    
            // contextmenu gets called - this is what we do
        ed.plugins.contextmenu.onContextMenu.add(function(th, m, e, col) {
    
            // remove all options from standard contextmenu
            m.removeAll();
    
            // only if selected node is an image do this
            if (typeof e !== "undefined" && e.nodeName.toLowerCase() == 'img'){
    
                th._menu.add({
                    title: 'Option 1',
                    icon: 'option1',  // you might need to specify an image here
                    cmd: 'custom_option' // call command custom_option
                });
    
                m.addSeparator();
    
                            // Second option
                //m.add({
                //  title: 'Option 2',
                //  icon: 'option2',
                //  cmd: 'custom_option2'
                //});
            }
                    else {
                       // you might want to hinder the display of the contextmenu in all other cases
                       // or present other options....
                    }
        });
        }
       });
    },
    
      // Register plugin
      tinymce.PluginManager.add('customcontextmenu', tinymce.plugins.customcontextmenu);
    
    
    })();
    

    Make sure the brackets are set right (i had to copy/paste and delete parts of the code so there might brackets be missing).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Inside my control, I have: ContextMenu = new ContextMenu(); ContextMenu.MenuItems.Add(new MenuItem(&Add Item, onAddSpeaker)); ContextMenu.MenuItems.Add(new
Hї! I have wrote test for my application. I need add item to database
I have a WPF contextmenu and I want to add an Item with Icon
I'd like to add a menu item to the default ContextMenu of a RichTextBox
I have some ContextMenu With some menuItems. One of the menuItems is Add Item....
I have code to add item to cache: public static void AddTask(string name, string
The Home sample in the android sdk doesn't implement the Add item, which bring
Take the example I have setup at http://jsfiddle.net/vEF6y/ Click on the 'add item' button
How can I add an item to a list if that item is essentially
I want to test Add new item activity in my application. When user fills

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.