I'm trying to make a functionality for users, so when they add a link in a body of some article(in text editor with other text), it displays as an image. Any ideas? Thanks)

  • you would have to override hook_node_presave or hook_node_save and filter the text from the given field - when it detects a valid image type it would change the link into an <img> tag
    – Geoff
    Commented May 7, 2015 at 4:05

1 Answer 1


CKeditor has the ability to add an image to a text field using its url:

This module will allow Drupal to replace textarea fields with the CKEditor - a visual HTML editor, usually called a WYSIWYG editor. This HTML text editor brings many of the powerful WYSIWYG editing functions of known desktop editors like Word to the web. It's very fast and doesn't require any kind of installation on the client computer.

enter image description here

enter image description here

  • Thanks man, I know all that stuff, but what I was looking for is the ability to add link directly to the body, without any buttons clicking. I mean user type text in editor(CKeditor or whatever) an just paste(or type) a link and when he save the node - link turn to image. Commented May 6, 2015 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.