0

I using image field with insert module to upload image. After select an image and upload, I press "insert". The image appears in body but the script of image doesn't have class "caption".

<img src="/sites/default/files/apple.jpg" title="Some description image here" height="260" width="500">

How do I add class "caption" into image?

3

There is an option in the Insert section of the field to add classes. See the screenshot below.

enter image description here

| improve this answer | |
  • @user73963 he is yourself !! :))) – David Mcsmith Aug 9 '15 at 8:57
-1

For adding caption to image there is some module

Image Caption

DESCRIPTION:

This module uses JQuery to dynamically add captions to images. The image title attribute is used to create the caption. It basically wraps the image in an html container div, takes the image title text and appends that in a child div underneath the image. Technically, it works by implementing Drupal's hook_nodeapi to add one small snippet of captioner jquery to the head section of the page when a node of the configured type is viewed.

Image Field Caption

Description: Adds an extra text area for captions on image fields.

Similar to the alt and title text fields available with an image field, the caption text area can be used to enter text or html descriptions of an image.

JCaption

Description: This is a simple module for Drupal 7.x that uses jQuery to transform the TITLE or ALT attribute of a image to a image caption. There is a settings page with lot's of possible configuration. The image caption won't show in the WYSIWYG-editor, but will be visible when you view the node.

The module differs in several ways from similar modules.

| improve this answer | |
  • I don't see how any of these address the OP's question which is to 'add class "caption" into image?' Before posting the same answer to multiple questions, please make sure you tailor them to the individual needs. If they are truly the same vote/flag as a duplicate. – mpdonadio Aug 9 '15 at 18:51
  • @MPD I thinks some misunderstanding happened here, ok ;) – Yuseferi Aug 9 '15 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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