Jump to content

ACF Advanced Content Filtering - broken?


darrenc
 Share

Recommended Posts

What I did

  1. edit the default 'body' field (textarea, ckeditor)
  2. field > body > input: "enable ACF" checked "yes" by default
  3. field > body > input: "extra allowed content" ...

The instructions indicate "Example: img[alt,!src,width,height]" in order to enable a tag with attributes you want to allow through the filtering.

a[class]

I wrote the above expecting that now i would be able to class my a tags in the editor, maybe make one a "button" style or whatever. However, this doesn't actually work as it seems Extra Allowed Content doesn't actually do what it indicates.

I've tried a dozen different variations and after googling here and seeing some responses in other threads, I think this should be addressed. The box is a nice way to enable a few attributes the user might want to allow for clients or themselves, I don't see why one would require making a module or going above and beyond the tools and text areas already provided in order to simply allow a few attributes.  I could turn ACF Off entirely, but that doesn't really address the problem: I want to filter the input for clients but still configure some tweaks that I deem would enhance and not break the site.

Simply: it's there, it's nice to have, should work right, but it doesn't seem to. Help?

 

 

Link to comment
Share on other sites

Adding a 'class' attribute to an element is different to adding other attributes, you add either allowed class names or a '*' wildcard within parenthesis.

// Allow *any* class name
img(*)

// Allow only specific class names
img(align_left,align_right)

// In your case (assuming any class name) it would be:
a(*)

Here's the CK Editor docs for Allowed Content rules:

https://docs.ckeditor.com/#!/guide/dev_advanced_content_filter

https://docs.ckeditor.com/#!/guide/dev_allowed_content_rules

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...