I've customized tinymce with some custom styles and enabled the style drop down menu. For example, there's a custom style called "red highlight" that applies the style "redhighlight".

My goal is to apply this style to some links. So if I create my content and highlight an entire link and apply the style, the wysiwyg window flashes, as if something has happened, but when I turn off the wysiwyg the source hasn't changed.

If instead I highlight only a small portion of the linked text and apply the style it works by putting a <span class="redhighlight"></span> tag around the selected portion.

Another example of something that won't work is if I click a tag in the "path" status bar at the bottom of the wysiwyg and apply a style. It seems that no matter what, if I select an entire tag this process fails.

Any suggestions for making this work? I've tried it with tiny mce versions 2.0.9 and 2.1.0.

Comments

newz2000’s picture

Ah, it seems the problem is only with links, and the way to apply styles to links is to do it from the link dialog (where you see it labeled as "classes"). Doing it this way works perfectly.
--
newz2000 on freenode

john_springer’s picture

I'm a noobie to drupal (but i've been hand-coding html for years.)
I want to be able to use the tinymce to simply APPLY a style/class
from the css style sheet in the theme. It works for the link ,as mentioned
above, but how do you do it for anything else? I certainly don't want to
go create a bunch of new styles inside tinymce, or is that what you have to do?

(My main site is on 4.7; also starting up some new 5.1 sites.)