Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The View Mode selector is confusing for people when they're creating a new bean, might it be possible to hide it if only "Default" and "Token" are the only ones currently available? It might be worth hiding "Token" anyway, it doesn't make sense as a display option anyway.
Comment | File | Size | Author |
---|---|---|---|
#10 | select-from-enabled-view-modes-1911234-6.patch | 1.15 KB | ozin |
#5 | select-from-enabled-view-modes-1911234-5.patch | 1.1 KB | kyletaylored |
| |||
#5 | Screen Shot 2015-12-21 at 5.30.17 PM.png | 31.44 KB | kyletaylored |
#5 | Screen Shot 2015-12-21 at 6.17.43 PM.png | 21.36 KB | kyletaylored |
#5 | Screen Shot 2015-12-21 at 5.29.47 PM.png | 27.7 KB | kyletaylored |
Comments
Comment #1
indytechcook CreditAttribution: indytechcook commentedThere is a permission that lets you hide it from users. 'edit bean view mode'
Comment #2
DamienMcKennaOh, cool, I'll work on a patch to the README.txt file to document this.
Comment #3
MrHaroldA CreditAttribution: MrHaroldA commentedMaybe a silly question: what does it do? I mean, I don't have such a view mode selector on any other entity, yet they all support view modes?
Can't the selector be omitted in total?
Edit: Seconds after submitting my question I realize that this is the only way to set the view mode. Silly me.
Comment #4
brahimmouhamou CreditAttribution: brahimmouhamou commentedWouldn't it be cool if you could select which view modes can be chosen by the content manager?
Because as mentioned above the 'Tokens' view mode is totally overrated most of the times but the CA.
On the 'Manage Display' page there is a section called 'Custom display settings' where you can enable your view modes so it would be nice if only this selection is available when choosing a view mode.
Is this possible now with Bean or another contrib module?
Comment #5
kyletaylored CreditAttribution: kyletaylored at LevelTen Interactive commentedThis is something that's been bugging me for awhile, so I wrote a patch for it.
Problem
The list of view modes that can be selected don't reflect the view modes that are enabled for that specific Block Type, thus can cause confusing for end users selecting the view mode when creating new blocks.
Solution
Select only from the list of view modes that are enabled for that specific Block Type. If no options are enabled, then provide "Default" as a fallback - which is exactly what this patch does.
Before
After
Enabled View Modes
Comment #6
fengtanTested patch #5, seems to work well. As suggested by @Rimbah, the view modes need to be selected on the 'Manage Display' page, which looks nice.
Comment #7
DamienMcKennaThere could be sites that depend upon being able to select from all available view modes, I'd suggest making it an option that can be disabled somewhere and maybe adding an update script to disable the option for existing sites. (we had a similar issue on Fieldable Panels Panes)
Comment #8
kyletaylored CreditAttribution: kyletaylored at LevelTen Interactive commentedIf a view mode isn't enabled, then how can it be utilized to begin with? I just want to understand, because I've never seen that use case before and seems fairly niche. I feel like if that was the case, they might've not been using the module correctly from the start?
Comment #9
ozinHi guys, I faced with the same issue and I think @kyletaylored is right. If u did not enable some view mode for the block it means u did not configured output for it so it means it should not be available on the block settings page. I think it make sense to show only enabled view modes.
Regarding update scripts, I think it is not needed here.
Comment #10
ozinI think the "Default" view mode should be available always.