darrenc

ACF Advanced Content Filtering - broken?

Recommended Posts

darrenc    19

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
LMD    23

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
darrenc    19

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 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

    • By Jonathan Claeys
      I just noticed when I try to do this in the ready.php that it can not retrieve the page. This works perfectly in the init. But since I need my languages I'm forced placing it in the ready. I'm just trying to get the child from a page.
      $pages->get("name=settings")->child(); Var_dumping that gives me a Nullpage. (and yes the name is correct since it does work in init.php but doesn't in ready.php) So I have no idea what I'm doing wrong, I was guessing maybe it's a bug?
    • By texobyte
      I have been plagued by this issue since day one. I cannot access or use any image I have uploaded. I can see them in the directory on the server and when I click on an image I can see a preview in the editor but as the video Video in my dropbox shows it doesn't provide me with a way to utilize those images. I can't see anything obvious.
      I did upgrade to 3.0.34 and have left the site pretty bare bones until this issue is resolved.
       
      Thanks in advance!
      processwire-images-bug.mp4
    • By oma
      I'm using PW 3.0.30 and there appears to be a bug. If the parent template for some children pages has the 'Sort settings for children' configured to a custom date field (or perhaps any field) I can still manually move/drag and drop the children articles on the Tree. I'm pretty sure this isn't correct and also that this isn't how it worked before v3?
      Thanks!