Hi there, I just tested out this module and it works great.

I was wondering if you could add a configuration option for each file type to specify the default view mode for the initial preview?

After I selected a media item from the media browser and hit submit I am presented with a really large image with a view mode selector below it in the modal dialog. After I change the view mode the image updates via ajax and works great. I was just hoping this option would prevent a really big image from loading initially, unless I'm just missing something.

Comments

gmclelland’s picture

In function media_wysiwyg_view_mode_form_alter I see there is a variable defined for wysiwyg_default_view_mode but I don't see this set in my database.

Should I be able to configure this somewhere or do I need to set this variable in the database manually somehow?

gmclelland’s picture

I see that the media module sets this to the "Full" viewmode as shown here http://drupalcontrib.org/api/drupal/contributions%21media%21includes%21m...

After adjusting the "Full" viewmode to a smaller preset it seems to work.

Should this be changed to the "WYSIWYG" view mode if this module is installed?

Maybe media module should expose this variable as a configuration?

devin carlson’s picture

Status: Active » Closed (works as designed)

The idea of the AJAX preview is to display what the file will actually look like using the selected view mode. This functionality only exists in the sandbox WYSIWYG View Mode in order to collect feedback on the feature until #1038884: Display image format preview on field insert as well as wysiwyg insert format page is fixed.

I'm going to mark this as "works as designed" since this functionality will be removed once #1038884: Display image format preview on field insert as well as wysiwyg insert format page is committed. I guess the final solution to that issue should include an option (via some checkbox on the administration page) to disable AJAX previews.

bgilhome’s picture

Sorry to reopen this, here's a patch to add an option to set default view mode per file type. I also removed the module's dependency on wysiwyg since I'm using the CKeditor (https://drupal.org/project/ckeditor) module and it seems to work fine.

gmclelland’s picture

@bgilhome - fyi... This module was moved into the media module recently. See #1792738: Allow custom file view modes for WYSIWYG display

I still think this would be a good feature to have. Can you open two new separate issues with your patches in the media module issue queue?

You might also want to post the links to the new issues as followups in #1792738: Allow custom file view modes for WYSIWYG display

I think you will get more reviewers there.

bgilhome’s picture

Thanks for the info @gmclelland - will do!

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 1823634)