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

stupiddingo’s picture

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

jcisio’s picture

Status: Active » Fixed

Thanks.

Status: Fixed » Closed (fixed)

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

filnug’s picture

Comment #1 worked for me.

Thank you for that comment!

bdimaggio’s picture

Anybody 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

filnug’s picture

Thanks.
Answer #5 worked for me.

Is it a better solution?
Those fix will stay after the ckeditor module update?

bdimaggio’s picture

I think it will, yes.

@jcisio, do you think it's worth changing this line in the Scald Installation/Configuration page?:

CKEditor 4.1 ACF
When you want to use ACF in CKEditor, you need to add the Atom Properties button in CKEditor toolbar because ACF is configured per-button. Otherwise, simply disable ACF feature with CKEDITOR.config.allowedContent = true;

to

CKEditor 4.1 ACF
When you want to use ACF in CKEditor, you need to:
* add the Atom Properties button in CKEditor toolbar (because ACF is configured per-button)
* add this to the ACF "Extra allowed content" field in your CKEditor profile:
div(*){*}[*];

Something like that would've saved me a lot of pain when setting up Scald.

jcisio’s picture

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

bwaindwain’s picture

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

editor.addCommand('atomProperties', {
  allowedContent: 'div[data-scald-sid,data-scald-align,data-scald-context,data-scald-options,data-scald-type](dnd-atom-wrapper,dnd-caption-wrapper)',
  exec: function (editor) {

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

scotwith1t’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Closed (fixed) » Needs work

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

nagy.balint’s picture

Status: Needs work » Closed (duplicate)

I think this task is now a duplicate of #2688638: CKEditor allowedContent spoils atoms