in
panopoly_images.module
we see
/**
* Implements hook_media_wysiwyg_wysiwyg_allowed_view_modes_alter().
*/
function panopoly_images_media_wysiwyg_wysiwyg_allowed_view_modes_alter(&$options, $context) {
if ($context->type == 'image') {
// Relabel some options
$options['default']['label'] = t('Original Size');
$options['teaser']['label'] = t('Quarter Size');
$options['preview']['label'] = t('Thumbnail');
}
}
However, at /admin/config/media/wysiwyg-view-mode
the default labels are in use:

Further, if the default view modes are restricted from use, as is the case in the image above, they still appear on WYSIWYG insert.
Removing panopoly_images_media_wysiwyg_wysiwyg_allowed_view_modes_alter() does respects a restriction put in place.
While the configurations are handy, there are valid use cases where some of these view modes are desired disabled for a site.
"Quarter Size" has proven confusing for content editors on our side, and too small.
I guess the most effective course of action would be wrap the label rewrite so that it respects the media_wysiwyg settings?
Relabeling the view modes consistently when listed in other contexts like the above is also advisable.
Perhaps rewritten in that context as "Default (original size)" would be clearest?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | panopoly_images-wysiwyg-view-mode-2449357-1.patch | 820 bytes | dsnopek |
| Media_WYSIWYG_View_Mode.png | 47 KB | andrew_mallis |
Comments
Comment #1
dsnopekDoes attached patch do what you were thinking?
Well, Panopoly doesn't enable the "media_wysiwyg_view_mode" module that provides that admin page. I suppose we could alter it anyway, but my gut inclination would be that if a site builder is enabling additional media modules, they know what they're doing. Although, I could probably go either way on this one. :-)
We already have an issue open for "Quarter size" being confusing:
#2295385: Improve description of Media image view modes, ex: "Quarter size"
Comment #2
andrew_mallis commentedmedia_wysiwyg_view_mode_media_wysiwyg_wysiwyg_allowed_view_modes_alter()so concise…
Need is not great on that front, but since we are implementing a function of the module, acknowledging its existence with a form alter would't be tragic.
patch works wonders @dsnopek
marking rtbc
thanks!
Comment #4
dsnopekThanks for the review! Committed. :-)