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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | media_wysiwyg_view_mode.ckeditor.default-view-mode.patch | 1.87 KB | bgilhome |
Comments
Comment #1
gmclelland commentedIn 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?
Comment #2
gmclelland commentedI 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?
Comment #3
devin carlson commentedThe 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.
Comment #4
bgilhome commentedSorry 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.
Comment #5
gmclelland commented@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.
Comment #6
bgilhome commentedThanks for the info @gmclelland - will do!