Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to theme/override an image inserted in CKEditor? #2882

Closed
ghost opened this issue Oct 16, 2017 · 4 comments
Closed

How to theme/override an image inserted in CKEditor? #2882

ghost opened this issue Oct 16, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 16, 2017

I need to be able to override the HTML for an image uploaded (or linked from an external URL) and inserted into a CKEditor field. I cannot find a theme_*() function that controls this however...

Is there a way to override images inserted into CKEditor from a contributed module?

@ghost ghost added the type - question label Oct 16, 2017
@docwilmot
Copy link
Contributor

Don't quite understand the question to be honest

@ghost
Copy link
Author

ghost commented Oct 17, 2017

When you add an image to CKEditor, you upload a file or specify an external URL, then CKEditor adds the HTML: an IMG tag with src, alt, height, width, data-file-id, etc. attributes.

I'd like to edit this HTML, to add additional attributes (automatically obviously, not manually each time I insert an image). I can do this with all other images by overriding theme_image(), but CKEditor doesn't use that theme function (I think it outputs the IMG tag itself)...

Does that explain it better?

@docwilmot
Copy link
Contributor

@BWPanda that's a problem. We came across this in #1580 (comment).
It doesnt seem there is a way to do this AFAICT.

@ghost
Copy link
Author

ghost commented Jan 27, 2022

Since this was just a question, and since it's been answered (not possible), and since there's been no further activity or people reporting the same thing for 4+ years, I'll close this issue now.

@ghost ghost closed this as completed Jan 27, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant