Media styles workaround (extremely fragmented notes)
Summary of What's Working
<?php
/**
* Define additional view modes for Media formatting.
*/
function feature_media_configuration_entity_info_alter(&$entity_info) {
// Based on RobW's code: http://drupal.org/node/1026790#comment-4667062
// Media module only recognizes view modes with the prefix media_.
// View mode for mobile slideshow images
$entity_info['file']['view modes']['media_mobile_slideshow'] = array(
'label' => t('Mobile Slideshow'),
'custom settings' => TRUE,
);
}
?>
Background
User generated styles exportable via Features
http://drupal.org/node/1189040
fabsor, this is great.
It adds File Styles and the export works.
Sorry in advance for hijacking this issue a bit... there is one key piece of configuration that doesn't seem to be exported by anything. That is the association of the
UPDATE file_display SET weight='0', status='1', settings='a:1:{s:11:\"image_style\";s:15:\"fixed_height_5x\";}' WHERE (name = 'image__media_continuum__file_image')
We have a pretty annoying bug/feature in Media at the moment, which is that the only way for images to actually show up is [to define a build mode related setting and attach the style to that]
We therefore had to create custom view modes (in code) to have a proper set of ex
The File Entity component is the key for exporting this relationship between build [mode and image style]
ctools_export_load_object
SELECT t__0.* FROM file_display t__0 WHERE (name IN ('image__media_continuum__file_field_styles_file_large', 'image__media_continuum__file_field_styles_file_medium', 'image__media_continuum__file_field_styles_file_original', 'image__media_continuum__file_field_styles_file_square_thumbnail', 'image__media_continuum__file_field_styles_file_thumbnail', 'image__media_continuum__file_field_file_default', 'image__media_continuum__file_image', 'image__media_continuum__file_field_media_large_icon', 'image__media_continuum__file_field_file_rendered', 'image__media_continuum__file_field_file_table', 'image__media_continuum__file_field_file_url_plain', 'image__media_continuum__media_vimeo_image', 'image__media_continuum__media_vimeo_video'))
ctools_export_load_object
SELECT t__0.* FROM file_display t__0 WHERE (name IN ('image__media_continuum__media_vimeo_image', 'image__media_continuum__media_vimeo_video'))
drupal_write_record
UPDATE file_display SET weight='0', status='0', settings='N;' WHERE (name = 'image__media_continuum__file_field_styles_file_large')
and a whole bunch like this:
drupal_write_record
UPDATE file_display SET weight='0', status='1', settings='a:1:{s:11:\"image_style\";s:15:\"fixed_height_5x\"; }' WHERE (name = 'image__media_continuum__file_image')
File Entity
image__media_continuum__file_image image__media_continuum_expanded__file_image image__media_related__file_image image__media_viewbook__file_image
Comments
Post new comment