1)
When the 'link' button is used, a window opens.
One of the fields is 'class'. It contains a drop down list of 50 classes from the style sheet.
How do you hide this field?

2)
While were on the subject, the image button does a similar thing.
It displays a load of irrelevant alignment options, when all that is needed is left, center and right.

Are these drop-downs configurable/avoidable?

Thanks.

Comments

twod’s picture

Status: Active » Fixed

I can't find any relevant options to change this. The closest I got was the class_filter option which can be set to a function reference. That function will then be called for each auto-imported class. We can't currently set this setting due to limitations in drupal_add_js() and the JSON format. You might be able to set it by editing the default settings in TinyMCE's files. It's probably easier to use some rules in your theme stylesheet to hide the box completely though.

You could probably create a script to filter out the values you don't need from the alignment box, but I have not looked into the details of that.

-Anti-’s picture

> It's probably easier to use some rules in your theme stylesheet to hide the box completely though.

Yes, something like 'display:none' would do.
But I don't think it can be done - nothing in that dialogue popup box seems to have a css class.

So, let me just clarify this - basically there are thousands of drupal sites using wysiwyg/tinymce, and no-one else but me minds that their users see a very long list of 'unintelligible garbage' when they want to make a link? Never mind what happens when they actually select something from the list, which then I assume styles their link with something totally inappropriate?

twod’s picture

"So, let me just clarify this - basically there are thousands of drupal sites using wysiwyg/tinymce, and no-one else but me minds that their users see a very long list of 'unintelligible garbage' when they want to make a link?"
Actually, you can include most sites which use TinyMCE, as this is not specific to Wysiwyg module. It's part of the advanced image/link plugins for TinyMCE, and I guess how sane the options are depends on the theme's stylesheet - which is by default what Wysiwyg module sets the content_css option to. You can also set content_css manually or make it use the editor's own stylesheets, it's on the profile page under CSS. If the stylesheet(s) added to the list only contain the styles which are actually used on the content, it probably makes a lot more sense. I had a feeling the TinyMCE developers would still include a way to override this setting, for cases where you need to include more obscure classes in your stylesheets, but like I said before I could only find the filter callback on the wiki.

So I tried Google again, and one of the first hits was a TinyMCE forum thread mentioning theme_advanced_styles. That setting is a string so we could set it on the server. Along with the advlink_styles setting to change the same thing for the advanced link plugin. Actually setting things like this using a GUI will be part of #313497: Allow configuration of advanced editor settings. Until then you can manually inject these settings using the technique in comment #30 of that issue.

I'm not sure what to do about the 'extra' options for image alignment though. Sometimes left/center/right just don't cut it, depending on where the image was inserted, so I would not mind having them there. In my experience, users tend to test various options until one combination meets their expectations without really reflecting over what each one means anyway.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.