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 8582627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:20:22+00:00 2026-06-11T21:20:22+00:00

I would like to add a toolbar button to CKEditor that shows the current

  • 0

I would like to add a toolbar button to CKEditor that shows the current color of the selection. Is this possible?

So far I managed to add a new toolbar button by following this tutorial and the colorbutton plugin, but I can’t find any example of a toolbar button with dynamic presentation.

  • 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-06-11T21:20:23+00:00Added an answer on June 11, 2026 at 9:20 pm

    You could use a transparent image for the button and set the background color of the button span within your plugins functionality.

    It looks like it might be easiest to get that span by finding the anchor tag with the title that you assigned (the tooltip) and then set the background color of the child span with id=cke_icon.

    This is what the HTML for one of my plugin buttons looks like, the name of the particular plugin that the button calls isn’t used, it’s functions are assigned variable function numbers, so the plugin name isn’t available:

    <a id="cke_33" class="cke_off" 
    onclick="CKEDITOR.tools.callFunction(71, this); return false;" 
    onfocus="return CKEDITOR.tools.callFunction(70, event);" 
    onkeydown="return CKEDITOR.tools.callFunction(69, event);" 
    onblur="this.style.cssText = this.style.cssText;" aria-haspopup="true" 
    aria-labelledby="cke_33_label" role="button" hidefocus="true" tabindex="-1" 
    title="Block Background Color">
    
    <span class="cke_icon" style="background-image:url
    (/ckeditor_3.6.1/plugins/cwmarcontentbackcolor/images/contentbackcolor16x16.png?t=B5GJ5GG);
    background-position:0 0px;"> 
    </span>
    
    <span id="cke_33_label" class="cke_label">Block Background Color</span>
    <span class="cke_buttonarrow"> </span>
    
    </a>
    

    It will be a fair amount of work if you want to determine the color each time the user selects a portion of the content area because they could select multiple elements with multiple colors. Even if they simply click in the content area, you may have to walk up the DOM tree to find the element that the cursor position is inheriting it’s color from.

    I helped with a plugin for another question that had a different goal, but it involved firing each time a selection was made, creating an object based on the selection, and walking up the DOM tree to look at the class assigned to the elements. You may be able to modify it to fit your goals:

    How to block editing on certain part of content in CKEDITOR textarea?

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

Sidebar

Related Questions

I would like to add button to toolbar or menu item to menu in
I have an existing toolbar and would like to add tabs to it that
I have own project and i would like add for this class same as
I would like to add a custom calculation method to a managed object (which
I ask this as I would like a global toolbar in my app (similar
I would like to add a gap between two buttons on an Eclipse toolbar.
The title is self explanatory. I would like to add a button to a
I add toolbar buttons dynamically based on settings file. I would like to assign
I have a ListView and each item have a TextView. I would like add
I would like to add a GestureDetector to all views (view groups) of an

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.