I've spent the better part of the afternoon attempting to utilize the ACF feature on ckeditor. I don't know exactly where I'm falling short, but none of the rules I set seem to have any effect.

I'm trying to disable any options in the image button besides the URL field, though actually I'd be satisfied with a removal of the height and width settings, as I want the images users add to be responsive.

This seemed like a simple addition according to their documentation found on this page, but I haven't found any success with either the custom or automatic setting for ACF. The rules just don't apply.

Am I utilizing the wrong syntax? What am i missing here?

I've attempted to add rules exactly as written on their documentation, such as:

config.disallowedContent = 'img{width,height}';

and also without the preceeding config., such as:

disallowedContent = 'img{width,height}';

I edited the actual config file in the module just to see what happened but this also yielded no success. Not sure what my next step is, so here I am.

Comments

highvoltage created an issue. See original summary.

highvoltage’s picture

Issue summary: View changes
highvoltage’s picture

Issue summary: View changes
TwoD’s picture

Status: Active » Fixed

Hey, sorry for the very long delay in getting to this support request.

Wysiwyg module does not load the original config file so any changes there won't have any effect.
Instead go to the editor profile and the "Cleanup and output" section of the CKEditor profile.
In there you can set ACF to either Automatic or Custom depending on whether you want full control of the rules, or just want to amend the default rules created from the enabled plugins and buttons.

Then in the textfield below you just add the rules themselves.

p img[!src,alt]

This will allow p tags without any attributes, and img tags with a required src attribute, and an optional alt attribute.
If you set the ACF mode to Automatic this won't actually have any effect as these rules are perfectly merged with the default rules for the Image plugin.
If you instead switch to Custom mode, a LOT of things will happen. First of all, any plugin or button not just producing p or img tags will be disabled completely. Second, most settings in the Image dialog will be removed, except for the URL and Alternative text fields.
Allowing the alt attribute is actually required for the Image dialog to show up at all, for accessibility reasons.

In Automatic mode Wysiwyg will use the extraAllowedContent settings instead of directly setting allowedContent, and as far as I know there is no way to actually specify disallowed content that a plugin has already allowed using that option. Custom mode will thus require you to specify every single tag, attribute and style needed by the plugins/buttons you want to keep enabled.

Status: Fixed » Closed (fixed)

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