First of all, great job including this functionality, it solves a ton of issues for content creators and site builders!
However, not getting it to work as I expect. i have restricted the view modes in the settings to "Ingress" (teaser), "fullstendig innhold" (full content) and WYSIWYG, but when I try to add an image my options are not these, but "Standard", "Ingress", "Forhåndsvis" (preview) and WYSIWYG. See screenshots:


..actually now I see that I always have "Standard", "Ingress" and "WYSIWYG" available, even if I'm not restricting to them. Have I misunderstood something here? What I typically want to to is create 2-3 specific view modes, like "content full | half | quarter width" and make only these available to insert into the WYSIWYG..
some potential clues: the site is localized, and I'm using CKEditor 4.3. Media and File Entity 2 alpha 3.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 2158177-media-wysiwyg-view-mode-ui.patch | 21.46 KB | dave reid |
| #12 | 2158177-media-wysiwyg-view-mode-ui.patch | 18.43 KB | dave reid |
| #10 | Selection_279.png | 53.17 KB | dave reid |
| #10 | 2158177-media-wysiwyg-view-mode-ui.patch | 18.85 KB | dave reid |
| #9 | 2158177-media-wysiwyg-view-mode-ui.patch | 18.84 KB | dave reid |
Comments
Comment #1
vegardjo commentedComment #2
vegardjo commentedI figured this out myself, but I'm allowing myself to keep the issue open and change it to a bug report, as I think the UI for this quite easily can be substantially clearer, and that the labels used are not accurate. There were two reasons for my original request:
..actually just changing what selecting a check box means (allowing in WYSIWYG, not disallowing) would solve all the above.
Comment #3
socialform commentedThank you Vegardjo.. I had the same problem. And plus one for your suggestion to check the view modes that should be shown.
Comment #4
workplaysleep commentedThanks & Agree, very confusing, the interface allows you to choose the view modes you want to disable.
I was about to rewrite the media_wysiwyg_view_mode_form_alter hook/function...
Comment #5
brightbold+1 for this UI improvement. "Allowed View Modes" in which the desired modes are checked rather than the disallowed ones, would definitely be more intuitive.
Comment #6
erixooon commented+1 to allow the checked ones!
My point: Every time I (or new module) create new view mode I have to visit WYSIWYG allowed view modes and check it to disable it. And I don't like it ;-)
Thanks.
Comment #7
chiebert commented+1 from me, too - I had to put my glasses on backwards in order to set this up right...
It would also make it a lot easier to add any other dependent configuration options to this form (eg., see #2194821-41: Embedded media objects should honor display suite settings)
Comment #8
dman commentedYes. Every time I go to these settings, I slowly and carefully think about what I want editors to be able to do... and then set the settings entirely backwards.
Comment #9
dave reidAgreed this was confusing. I propose that we revise some wording and move this configuration to the file type edit forms. I don't think there should be a need for a separate admin page just for this, since it gets really long with lots of file types and view modes.
Comment #10
dave reidScreenshot of the new UI, on the file type page.
Comment #11
dave reidNote that this requires the current 7.x-2.x-dev of File Entity which has #2550409: File entities do not support entity_view_mode_prepare() included.
Comment #12
dave reidOk, removed hook_media_wysiwyg_token_to_markup_alter() too.
Comment #13
dave reidComment #17
dave reidThis should pass tests.
Comment #19
dave reidTested and committed #17 to 7.x-2.x.
Comment #20
dman commentedBravo Dave!
I'll try to make some time to try it out at work today. I've got some editor UX refinements on my schedule to do I may be able to slip this into.
Comment #21
dave reidIf we want to switch around how this works to an "allowed" vs "restrict" method, let's follow-up with #2479947: Switch to using an 'allowed view modes' logic instead of restricting view modes. That's a much larger change which would also require an upgrade path to rename variables.
Comment #22
dave reidAlso the committed patch doesn't show any view modes that haven't been enabled, so it matches the actual view modes available in the embed dialog (by actually using the same API function).