darrenc

ACF Advanced Content Filtering - broken?

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?

 

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

OHHHHHHHHHHHhhhhhhhhhhhhhhhhhh. God, I feel dumb but honestly I was totally perplexed by that. 

Thank you so much LMD. I will try it out and see.

Share this post


Link to post
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


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By benbyf
      One of my clients found a bug when viewing the PW admin on chrome using windows - the admin tab nav doesn't appear, they could only see the tool icon either though they were a superadmin user. When viewed on Edge the tabs where present. The site is running on PW 3.0.62 with the default admin.
      I was screen sharing with my client when we found the bug, I don't actually have anyway to test this and see what's wrong myself as I dont run windows and dont currently have a cross broswer testing suite. Could someone please look into it briefly?
    • By dreerr
      In PW 3.0.80 I've experienced a bug when using multiple Page Ref fields. The Select button keeps fading in and out again. I've made a video to illustrate the problem. Any ideas how to solve this?
      video showing the error: PageRefError.mov
      greetings, d.
    • By theoretic
      Hi everyone! And thanks again for a perfect product.
      It appears there's a small bug in the implementation of fieldset. If we rename a field of type FieldsetTabOpen, the auto-created field of type FieldsetTabClose won't auto-rename. E.g. if we create a fieldset called "noises", two fields will be created -- "noise" (type: FieldsetTabOpen) and "noise_END" (type: FieldsetTabClose). And when we later rename the field "noise" to "acoustics", the field "noise_END" still keeps its name. The auto-generated field description will also remain unchanged.
      This is only a minor bug, but removing it could make the Processwire even better. Thanks in advance!
    • By CarloC
      Hi everyone!
      this is my first topic and I need to say thanks to @ryan and all the other contributors for this incredible framework that changed my life as a web dev!
      But now I go to the point. I developed a project with pw 2.7 and it worked like a charm.
      Today i'm trying to update the project to pw3 on a local environment, to test that everything will continue working after the upgrade, and that's not the case.
      The major bug I'm encountering is that repeater field doesn't work properly.
      Existing Repeater field
      This is what I see when I try to edit a page that already has a repeater field (Brand concepts) with some elements:

      If I click on one of the "... blocks" nothing appens.
      New repeater field
      If I create a new repeater field and assing it to a template, when I open a page with that template I see the new repeater field, but the "Add new" link, to add a new element, doesn't work. I click it and nothing appens.

      I never had this kind of strange behaviours in PW, and this is one of the reasons why I consider it the best cms/framework I've ever used.
      I hope you can help me.
      Thank you!
    • By didhavn
      Hey all.
      I just came across a potential error in the FieldtypePassword.
      I have a password field added to some templates to protect the pages. However, whenever I want to save a page, I get the error of "required fiield missing"...that the password field is required and missing. But, the field is not set to required.
      Can anybody confirm that and/or has a solution?
      Best, Lukas