Hello!

The image field (Drupal Core) has a "alt" and "title"-field to save additional information for an image. Is it possible to show this information in a view?

Views 6 (used with imagefield) had a special field
field: content-*Name of the field*-data
that could be used to show this information.

Is something similar possible with views 7?

Comments

dawehner’s picture

In theory it should be possible to do this if there is a placeholder which just shows the alt/description text.
That's the recommended way to do it, and it will not change.

Just use a column in the database will not work, because you can only render a full field.

Sadly there is no formatter for this, so this have to be solved somewhere else in contrib world.

dawehner’s picture

You could use for example http://drupal.org/project/custom_formatters, too.

MJH’s picture

Thanks for the help! I will try to get this working (the module "Custom Formatters" you mentioned looks promising).

bojanz’s picture

Status: Active » Fixed

Custom formatters are definitely the way to go here.

knalstaaf’s picture

Can you give a code sample to show the ALT-text in that custom formatter please?

dawehner’s picture

Please be fair and ask this kind of questions somewhere else.
Views is not the central place to ask all drupal questions :)
Custom Formatters module might be a good place to do this.

Status: Fixed » Closed (fixed)

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

clemens.tolboom’s picture

Hmmm ... weird we need to do this.

Anyway some hints for using custom_formatters

I installed devel module then added dsm($variables); on top of admin/config/content/formatters/edit/3

dsm($variables);
return ($variables['#item']['uri'])
  ? $variables['#item']['uri'] . " " . l(t("<sup>Custom Formatter Example</sup>"), 'admin/config/content/formatters', array('html' => TRUE))
  : '';

which reveals the variables to use. This leads to

return ($variables['#item']['title'])
  ? $variables['#item']['title']
  : '';

Hope this helps a little. For more info goto http://drupal.org/project/custom_formatters for support.