Remove the items from the class dropdown list on the TinyMCE link button and popup

When using TinyMCE and clicking the link button, a popup window will appear asking for link details. One of the fields in this popup is for adding a CSS "Class".

Is there a way to clear this list? I noticed that there is a plugin setting within advlink where you can input a list of CSS classes, but I prefer not to use advlink as I want to avoid having the extra popups and tabs in the link window.

Answer №1

If you eliminate the line content_css : "/css/mycss.css" from your TinyMCE settings, the Class dropdown will not show up in the link dialog because it will no longer recognize the styles present in your website's CSS.

I trust this information is useful to you!

Answer №2

Check out this example on tinymce. By examining the configuration, you will see the specified setting (style_formats)

// Style formats
    style_formats : [
        {title : 'Bold text', inline : 'b'},
        {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
        {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
        {title : 'Example 1', inline : 'span', classes : 'example1'},
        {title : 'Example 2', inline : 'span', classes : 'example2'},
        {title : 'Table styles'},
        {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
    ],

With this tinymce configuration setting, you can specify which styles are visible in the style dropdown list and the css field of the link popup.

Update: Unfortunately, the above does not affect the class dropdown in the popup. Here is the correct way to configure the setting for examples:

 advlink_styles: 'Code=code;Excel=excel;Flash=flash;Sound=sound;'  

You are already using the advlink plugin, so feel free to implement this configuration setting. See how it works!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Achieving successful functionality with position:relative in IE9

Having difficulty with the position: relative property in IE9. Check out this demo for reference: <div style="overflow:scroll;height:120px;"> <table id="table" width="100%"> <tr style="position:relative;background-color:#1b72a4;"> ...

Photo Label fails to adjust size correctly when loading two sources (png and webp)

Currently, I have been working on a website that showcases a 3D book: https://i.sstatic.net/oC1nL.png The challenge I am facing is to ensure support for both png and webp images across all browsers. Initially, when I load just one image, everything works ...

Vertical alignment of label in the middle of the page is malfunctioning

Check out this fiddle for placing text in the middle of the page vertically. Fiddle HTML: <label class="label"> This text should be centered </label> CSS: .label{ vertical-align: middle; } Despite setting the CSS property, the text is ...

Ways to extract certain characters from each element in an array

I'm attempting to make the first four characters of each element in an array (specifically a list) bold, but I am only able to select entire strings: $("li").slice(0).css("font-weight", "Bold"); Is there a way for me to indicate which characters wit ...

The Owl carousel animation fails to work in Chrome browser

I am currently customizing an HTML5 template that utilizes the Owl Carousel 1.3.2. My goal is to incorporate a smooth fade animation when transitioning between slider images. The code snippet below works perfectly in the Mozilla Browser, however, I'm ...

Arranging text in alignment on a single line with Vuetify

I am attempting to format text in a way that it is aligned with part on the left side of the card and the other part on the right (with space between them). However, when using class="text-right", the text gets moved down. Does anyone have any ideas on h ...

The jQuery menu is malfunctioning in Internet Explorer due to the Document Mode being set to Quirks

I am encountering an issue where the below code is not functioning properly in Internet Explorer's document mode quirks. Each time I hover over the submenu, its length doubles unexpectedly. Can someone please provide assistance with this matter? < ...

Issue with making a call to retrieve an image from a different directory in ReactJS

This is how it appears <img className='imgclass' src={"../" + require(aLc.value)} alt='' key={aLc.value} /> I am trying to create a path like ../m/b/image.jpg, where aLc.value contains the path /m/b/image.jpg. I need to add only ...

Prevent css from reverting to its original rotation position

I attempted to style the navigation list with the following CSS: #navlist:hover #left-arrow { border-top: 10px solid white; position: relative; transform: translateX(120.2px) rotate(180deg); } Would it be better to use jQuery for the rotation ...

The custom classes I have created in Material UI are being overshadowed by the default classes provided by Material UI

I am trying to change the color of a TextField label to black when it is focused. I used classes in InputProps with a variable, but unfortunately, the default styling of material UI is taking precedence in chrome dev tools. Below is the code snippet. Pleas ...

Center the table element horizontally on an HTML page

I am facing an issue where my angular material and css table are not taking the full width of my div. Additionally, I want to set the image in the header as a background. Here is the link to my work on StackBlitz: https://stackblitz.com/github/lnquaidorsay ...

What is the method to deactivate multiple links using jQuery?

Below is the HTML code: <a title="Login" data-href="/MyAccount/Access/Login" data-title="Admin" data-entity="n/a" id="loginLink" class="nav-button dialogLink"><b>Login</b></a> <a title="Register" data-href="/MyAccou ...

Exploring the benefits of incorporating the vendor folder in website development

I'm embarking on the journey of creating a website from scratch with python, django, and bootstrap. I've noticed that it's common practice to store js, css, img, and fonts in a folder named vendor, like this: /static/js/vendor/bootstrap/boo ...

Words fail to display

.sport { content: url("../img/sport.png"); background-color: rgba(0,0,0,1.0); top: 61px; height: 310px; width: 300px; position: absolute; margin: 0; left: 0; border-radius: 4px; overflow: hidden; } .sportsandactivis { background-colo ...

highlight the selected option in the ng-repeat list of items

Looking for some assistance with a coding problem I'm having. I keep running into an error when trying to make a selected item in an ng-repeat list highlight. The CSS style is only applied on the second click, not the first. Additionally, I need to en ...

The CSS fullscreen background appears to function properly in Dev-tools, but fails to display correctly in an actual browser

I recently created a Meteor App/Website and I am encountering an issue with the fullscreen background image at the top of the page (). While the image displays correctly in Chrome Developer tools and Safari Responsive Design mode, it appears zoomed in on ...

Is there a way to have a content's columns adjust to the size of an image?

I'm currently struggling with a layout issue. I have an image on the left and want the content columns on the right (title, lorem...) to adjust their height to match the image. How can I achieve this? I'm using Bootstrap v5.1.1 Current image: ...

Tips on customizing KendoUI-Dialog titlebar using CSS for a single component

I am struggling with styling the KENDO UI dialog in a unique way: Imagine I have a component named WatComponent. Inside this component, When the user clicks the "Forbidden" button, my goal is to make a warning styled dialog appear, with a yellow/orange ...

adjust the vertical size of a specified container

I am attempting to have the green div fill the height regardless of the content in the yellow div. Both the green and yellow divs are contained within the grey div. Refer to the following code for clarification: http://jsbin.com/ofelov/1/edit (As for th ...

Arranging items in a flex container

My goal is to achieve the following layout with flexbox: #box { display: flex; flex-wrap: wrap; flex-direction: row; justify-content: center; justify-items: center; align-items: center; } #spotLight img { width: 15%; height: 15%; } # ...