Currently you can only set the Caption to title or alt, but I don't think these are available in the Image type from Media module. I have added a field to the Image type and would like to use it instead.

Comments

jdanthinne’s picture

Status: Active » Postponed (maintainer needs more info)

I don't understand how you add a field to the Media field?

mattcasey’s picture

You can add fields like you used to be able to in CCK, by clicking Manage Fields for any of the types at admin/config/media/types

jdanthinne’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks, I wasn't aware of that (I don't use Media).
I will have a look to find how to integrate this

mattcasey’s picture

Thanks, I've got a workaround now but this would be great to have in the future. Field slideshow is much less hassle than Views Slideshow. In this case, I would have had to manage multiple image nodes to display each image separately in Views, and there's no Image Attach capability in D7. And Media module is definitely worth looking into, although I don't know how stable their API is just yet.

bryancasler’s picture

subscribe

webankit’s picture

Both this and image link support will be great...
you can also see rotating banner but it provides a block of slides ... with an integration of media module...
a combination will be gr8 tough...
Thanks

jdanthinne’s picture

@babbar.ankit : I don't understand what you say…

webankit’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc2
Status: Needs review » Active

I was suggesting a similar module:
Rotating banner... , it utilizes media module & can create a block of slides [images] but we can't use it with cck fields..
So, an integration of these modules.. will be great...
Thanks

jdanthinne’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Status: Active » Needs review

At last, I've understood how Media seems to work ;-)
I've just pushed a new DEV version that support Media fields for Caption (scans every text field attached to Image Media fields and adds them as options for Caption text).
Please download next DEV or use http://drupalcode.org/project/field_slideshow.git/patch/f83a6dc.

jdanthinne’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Status: Active » Needs review

Additionaly, I've just added support for links as well (image and caption can link to link or nodereference fields of Media).

mattcasey’s picture

Thanks, the fields appear as expected with Media 7.x-1.x-dev (2011-Apr-11). One issue is if you haven't created a field yet, then it complains

Notice: Undefined index: caption in theme_field_slideshow() (line 549 of /.../modules/field_slideshow/field_slideshow.module).
Notice: Undefined index: caption in theme_field_slideshow() (line 556 of /.../modules/field_slideshow/field_slideshow.module).

I fixed this by first checking to see if the variable is set:

    // Generate the caption
    if (isset($item['caption']) && $item['caption'] != '') {
      $caption_output = '<div class="field-slideshow-caption"><span class="field-slideshow-caption-text">' . $item['caption'] . '</span></div>';
    }
    else $caption_output = '';

    // Add links if needed
    $links = array('path' => 'image_output');
    if (isset($item['caption']) && $item['caption'] != '') $links['caption_path'] = 'caption_output';
jdanthinne’s picture

Status: Needs review » Fixed

Thanks. Pushed to DEV.

Status: Fixed » Closed (fixed)

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