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:
WYSIWYG allowed view modes for files

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?

Comments

dsnopek’s picture

Status: Active » Needs review
StatusFileSize
new820 bytes

I guess the most effective course of action would be wrap the label rewrite so that it respects the media_wysiwyg settings?

Does attached patch do what you were thinking?

Relabeling the view modes consistently when listed in other contexts like the above is also advisable.

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. :-)

"Quarter Size" has proven confusing for content editors on our side, and too small.

We already have an issue open for "Quarter size" being confusing:

#2295385: Improve description of Media image view modes, ex: "Quarter size"

andrew_mallis’s picture

Status: Needs review » Reviewed & tested by the community

media_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!

  • dsnopek committed feee356 on 7.x-1.x
    Update Panopoly Image for Issue #2449357 by dsnopek: Relabeled view...
dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the review! Committed. :-)

Status: Fixed » Closed (fixed)

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