In #1291428: Add a 'full' view mode and use it for file/%file pages, we added a Full view mode for file entities. In #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original, we decided to deprecate some of the Media module view modes, but keep Preview and add Teaser. However, discussed this today in IRC, and there's nothing Media-specific about Preview and Teaser, so these should be defined by the File Entity module. This patch does so, and uses Preview on the file/FID/edit page. There's no in-code use-case for Teaser, but a common administrative use-case would be to add a file field to a content type, and use the rendered file formatter (with View mode = Teaser) when the content is displayed as a teaser.
Comment | File | Size | Author |
---|---|---|---|
#15 | file-entity-teaser-preview-1296268-15.patch | 2.94 KB | RobW |
#13 | file-entity-teaser-preview-1296268-13.patch | 2.34 KB | RobW |
#10 | file_entity_teaser_preview-1296268-10.patch | 2.34 KB | steinmb |
#3 | file_entity_teaser_preview-1296268-3.patch | 2.36 KB | jief |
#2 | file_entity_teaser_preview-1296268-2.patch | 2.74 KB | pbuyle |
Comments
Comment #1
Dave ReidFile entity has switched to a 7.x-2.x branch and the 7.x-1.x branch is no longer used. Please make sure to update your Git clones.
Comment #2
pbuyle CreditAttribution: pbuyle commentedThe original patch applied on the 7.x-2.x until recently. Here is a reroll for the 7.x-2.x branch.
Comment #3
jief CreditAttribution: jief commentedHere a new reroll for the 7.x-2.x branch following the upgrade from January 13
Comment #4
Dave ReidComment #5
nodecode CreditAttribution: nodecode commentedjust wondering what needs to happen for this to be implemented? waiting on this to be implemented to resolve a related issue http://drupal.org/node/1051090#comment-5061900
Comment #6
RobW CreditAttribution: RobW commentedSeems to be working fine for me.[Edit] Ok, this actually doesn't seem to be working for me. Sorry for polluting the issue queue updates, I need to give it a couple hours before I post here from now on.The patch in #3 doesn't seem to be changing anything.
Comment #7
RobW CreditAttribution: RobW commentedFurther investigation:
When applied by itself, with Media 2.x-dev:
No change to the view modes on Manage File Display,
In a content type's Manage Field Display, the rendered file select box lists "Full, Teaser, Preview, List, Preview, Small, Large, Original, Tokens".
When applied with the latest #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original patch:
The view modes on Manage File Display show "Default, Link, Original",
The rendered file select box lists "Full, Teaser, Preview, Link, Original, Tokens".
Comment #8
RobW CreditAttribution: RobW commentedAhh, this was my fault. In previous versions the view modes provided by Media were enabled by default. After applying these patches on a fresh install, you'll have to go to File Types -> Manage Display and check the view modes you want to set custom displays for in Manage Display and Manage File Display.
This is closer to the way core handles custom view modes in the fields ui, and I like that. My only suggestion would be if teaser is meant to be the equivalent of teaser in fields, it should be enabled by default.
Comment #9
steinmb CreditAttribution: steinmb commented+1 to enable the teaser pr. default. btw, what is blocking these two patches from going in?
Comment #10
steinmb CreditAttribution: steinmb commentedTrying to get this issue moving again. Patch no longer apply. Re-rolling, though untested.
Comment #11
mrfelton CreditAttribution: mrfelton commentedSeems that it's impossible to export the display settings for Image display in teaser mode through features. To reproduce:
You cant. It's possible for all other view modes, including ones created with Display Suite. But for some reason, when it comes to the teaser mode, you can only export settings for some but not all of the display styles. This is what I could get into my feature:
Contrast with exports from other view modes:
The one that's missing is the
__file_image
settings - the settings for the Image display style. There should be aimage__teaser__file_image
display. This doesn't appear as an option in the features file_display export options. I tried adding the relevant code to the feature manually, but when you do a revert the settings just get wiped out. ie. What I added manually was simply ignored.Comment #12
mrfelton CreditAttribution: mrfelton commentedActually, I think the problem noted above is because media module is implementing hook_file_default_displays(). Setting this back to needs review. Issue created in media module #1702700: Implementation of hook_file_default_displays makes it impossible to export image display settings via features.
Comment #13
RobW CreditAttribution: RobW commentedDuplicate of #10 with teaser
'custom settings' => TRUE
to follow the pattern of Drupal's default content types.I've been using #10 for a while with the patches in #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original, and they're working fine. When we decide if teaser has custom settings by default, IMO this is RTBC.
Comment #14
RobW CreditAttribution: RobW commentedA couple minor details.
Should we include one in file entity? Maybe something more general:
Comment #15
RobW CreditAttribution: RobW commentedSet the Preview view mode to have custom settings by default and added a warning to its manage file display page. Tried to get a little more general with the warning:
Nodes have a closer connection to content, so "teaser" and "full content" make sense there. I think "full" is fine here.
Comment #16
Devin Carlson CreditAttribution: Devin Carlson commentedThe patch in #15 applied cleanly and successfully added the Preview and Teaser view modes.
Tested by:
Comment #17
madar CreditAttribution: madar commentedI applied #15 and #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original.
File preview on edit form working as expected after setting up 'Manage File Display' of image file type.
Also works on media_gallery multiedit page with multiform module.
Comment #18
ParisLiakos CreditAttribution: ParisLiakos commentedremoved space before isset and commited
yay!
Comment #19
RobW CreditAttribution: RobW commentedNiiiiice! Follow up with #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original?
Comment #20
ParisLiakos CreditAttribution: ParisLiakos commentedhmm, sorry for giving all commit credit @RobW, :/
steinmb, mongolito404, jief and effulgentsia whose original work this is i owe you one!
and i definitely need some sleep after commiting #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original
i hope you are good with some irc karma:P
Comment #21
RobW CreditAttribution: RobW commentedYeah, I just tied up the loose ends. Thanks and credit to everyone else for writing the meat of it.
Comment #22
steinmb CreditAttribution: steinmb commentedGreat work everyone! :) Both this and the revamped view-mode patch got in, and at the same day. YAY!