Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When editing a previously saved article that contains a Scald Atom, such as an Image, the Atom (Image) does not appear in the CKEditor - only the caption text renders. The image will appear when toggling the Context, and will be present when saving the article. This might be confusing for users.
What do I need to configure so that the images/atoms appear consistently in the CKEditor text area?
Comments
Comment #1
stupiddingo CreditAttribution: stupiddingo commentedI just ran into this same behavior and in my case it was caused by ckeditor's Advanced Content Filter. The homepage of scald mentions this, "allowedContent setting may trouble some providers. It is recommended to disabled it. Issue in Drupal core (D8) and in CKEditor (D7)."
In short, either add to advanced section of the CKEditor profile:
config.allowedContent = true;allowedContent
Or in the UI for ckeditor (admin/config/content/ckeditor/edit/Advanced) under Advanced content filter to disabled.
Comment #2
jcisio CreditAttribution: jcisio commentedThanks.
Comment #4
filnug CreditAttribution: filnug commentedComment #1 worked for me.
Thank you for that comment!
Comment #5
bdimaggioAnybody else running into this issue: if you like ACF for the powerful un-stupiding effect it has on pasted-in content, you can still keep it and Scald images! Short version of this fix: edit your CKEditor profile, open the "Advanced Content Filter" vertical tab and add this to the "Extra allowed content" textarea:
div(*){*}[*];
Long version: http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
Comment #6
filnug CreditAttribution: filnug commentedThanks.
Answer #5 worked for me.
Is it a better solution?
Those fix will stay after the ckeditor module update?
Comment #7
bdimaggioI think it will, yes.
@jcisio, do you think it's worth changing this line in the Scald Installation/Configuration page?:
to
Something like that would've saved me a lot of pain when setting up Scald.
Comment #8
jcisio CreditAttribution: jcisio at Axess Open Web Services commentedI think instead of doing that manually, simply select "Disabled" in the "Advanced content filter" of CKEditor is a better solution (it's want "Otherwise, simply disable ACF feature with CKEDITOR.config.allowedContent = true;" means in older CKEditor versions).
While it's the shortest way to get it work, and it works with all providers, a better way is to let Scald configure these rules. However there is still some bugs like #2612296: Embedded atom disappear when editing content.
Comment #9
bwaindwain CreditAttribution: bwaindwain as a volunteer commentedTo anyone reading this, for "Extra Allowed Content", the slightly more accurate setting would be
div[data-scald-sid,data-scald-align,data-scald-context,data-scald-options,data-scald-type](dnd-atom-wrapper,dnd-caption-wrapper)
As an alternative, I found that if I add the allowedContent line to the scald/modules/fields/mee/plugins/dndck4/plugin.js around line 137, ACF works properly without the above bit of code.
Adding the ScaldAtom button to the toolbar doesn't seem to accomplish anything.
The ScaldAtom button doesn't even show up for me. I have the "Scald Drag and Drop integration - CKEditor 4 widgets" plugin enabled but the button doesn't appear. I have to add it manually (by turning off CKEditor "Use toolbar Drag&Drop feature" under global profiles).
Comment #10
scotwith1t@jcisio, Simply disabling ACF is NOT a solution and this issue should not have been closed with that as a "solution". This completely defeats the purpose of ACF's, as @bdimaggio so elegantly put it "powerful un-stupiding effect it has on pasted-in content". We want to, for instance, stop our very un-tech-savvy editors to not be able to paste in content that has inline styles and such dumb things. ACF makes all that stuff go away on paste, so leaving it enabled is the right way to handle. The solution should be to properly inform Scald users how to properly configure ACF, as both @bdimaggio and @bwaindwain have provided examples of. Or better yet to include the code in the plugin by default so that ACF can just be left enabled and the plugin's config handles adding the needed allowedContent. Please consider a more long-term solution like those proposed! Thanks.
Comment #11
nagy.balint CreditAttribution: nagy.balint commentedI think this task is now a duplicate of #2688638: CKEditor allowedContent spoils atoms