function panopoly_widgets_file_default_displays_alter in Panopoly Widgets 7
Implementation of hook_file_default_displays_alter()
File
- ./
panopoly_widgets.module, line 533
Code
function panopoly_widgets_file_default_displays_alter(&$default_displays) {
// Display the 'Generic file' display on video preview.
if (!empty($default_displays['video__preview__file_field_file_default'])) {
$default_displays['video__preview__file_field_file_default']->status = FALSE;
}
// Set the default video configuration for videos
if (!empty($default_displays['video__default__media_vimeo_video'])) {
$default_displays['video__default__media_vimeo_video']->weight = 0;
$default_displays['video__default__media_vimeo_video']->settings['protocol_specify'] = FALSE;
}
// Set the default image style for videos to be our custom video image style
if (!empty($default_displays['video__default__media_vimeo_image'])) {
$default_displays['video__default__media_vimeo_image']->settings['image_style'] = 'panopoly_image_video';
}
// Set the teaser image style for videos to be our custom video image style
if (!empty($default_displays['video__teaser__media_vimeo_image'])) {
$default_displays['video__teaser__media_vimeo_image']->settings['image_style'] = 'panopoly_image_video';
}
// Set the preview image style for videos to be our custom thumbnail image style
if (!empty($default_displays['video__preview__media_vimeo_image'])) {
$default_displays['video__preview__media_vimeo_image']->settings['image_style'] = 'panopoly_image_thumbnail';
}
}