Problem/Motivation

Create an image field to an entity/node. When editing the fields settings, you can choose and upload a default image. There is currently no option to give the default image a title or alt field.

Proposed resolution

Add title and alt fields to default images.

Remaining tasks

All

User interface changes

Add title and alt fields to default images, once they have been uploaded.

API changes

Unknown.

Original report by LTech

I have a default image uploaded for a cck image field. I would like the title on the node to show when you hover over the image. How do I do this?
Thanks

Comments

neRok’s picture

Title: show title when hover over default image » Add title and alt 'fields' for default images of an Image Field.
Version: 7.9 » 8.x-dev
Category: support » feature

This would actually be a good feature request, along with a default alt field.

In the mean time, you will have to add the title with some code. You can do it with the following in your themes template.php

function YOURTHEME_preprocess_node(&$variables) {
  if (isset($variables['content']['field_YOURIMAGEFIELD'][0]) && $variables['content']['field_YOURIMAGEFIELD'][0]['#item']['is_default'] == TRUE) {
    $variables['content']['field_YOURIMAGEFIELD'][0]['#item']['title'] = t('YOUR DEFAULT TITLE');
  }
swentel’s picture

Component: field system » image.module
punitbook’s picture

Thanks for updating me I was actually seeing the way to perform this activity and had already spend huge time to research.

claudiu.cristea’s picture

Status: Active » Closed (duplicate)

I see #1443606: Alt, title, width and height for default images as a duplicate. Let's move there.

claudiu.cristea’s picture

Issue summary: View changes

Issue updated to suit feature requrest and summary template used.