Current version doesn't have any provision to set default image(from mediafield) for a content type.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

roynilanjan’s picture

Please have a look the patch let me know view

roynilanjan’s picture

Status: Active » Needs review

Please review

Status: Needs review » Needs work

The last submitted patch, default_image_media-mediadefaultimage-2042363-2.patch, failed testing.

roynilanjan’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, default_image_media-mediadefaultimage-2042363-2.patch, failed testing.

roynilanjan’s picture

Status: Needs work » Needs review
FileSize
972 bytes

Re-generated patch to review

roynilanjan’s picture

For review again the patch!

Dave Reid’s picture

Category: task » feature
Priority: Critical » Major
Issue tags: +7.x-2.0 beta blocker
jienckebd’s picture

Hi roynilanjan,

This patch does allow you to set a default image for each field, but I'm not seeing how the image set on the field settings form is actually used when the field is rendered.

Bryan

roynilanjan’s picture

@jienckebd yes you are correct for this mentioned branch we have to implement hook_field_update_field & hook_field_update_instance to render that field along with default setting value in a node, although I have seen that if i mention any media image with the specific node still not rendering properly, it produces the link only & even style not properly generating... may be it's still under work.

previously for 1.x branch even the multimedia asset doesn't render automatically , you need to inject

theme_image_style()

to get rendered

what do you think? please share your view...

roynilanjan’s picture

still I think we need to implement theme_image_style to render the media asset in a node body.
even if we have default image ,
other wise style will not generates in file system,
e.g, for default image settings can be utilized as

// this is for default settings for which above patch introduced,
// please change the media field name as your own.
$field = field_info_field('mediafield-name');
$file = file_load($field['settings']['default_asset']['fid']);

if ($file) {
  $unit_image = theme('image_style', array(
    'style_name' => 'thumbnail',
    'path' => $file->uri,
    ));
  }
ParisLiakos’s picture

Component: Code » Media field
Priority: Major » Normal
Issue summary: View changes
Issue tags: -7.x-2.0 beta blocker

Given that media field is deprecated, i wonder why this is a beta blocker

roynilanjan’s picture

@ ParisLiakos can you please show how do you get that media field is deprecated?

ParisLiakos’s picture

SocialNicheGuru’s picture

Component: Media field » Code

is patch #7 for media 7.1.x? I didn't think there was a mediafield in 7.2.x.

SocialNicheGuru’s picture

Status: Needs review » Needs work
Chris Matthews’s picture

Status: Needs work » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team