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.
If you add multiple view modes to a block type, you can choose your view mode when adding/editing a block of that block type.
Problem is that on the view page of that block the content is always rendered with view mode 'default' instead of the selected view mode.
Comment | File | Size | Author |
---|---|---|---|
#3 | render-view-page-selected-view-mode-2375291-3.patch | 459 bytes | kyletaylored |
|
Comments
Comment #1
brahimmouhamou CreditAttribution: brahimmouhamou commentedComment #2
wiipiiw CreditAttribution: wiipiiw commentedSubscribing
Comment #3
kyletaylored CreditAttribution: kyletaylored at LevelTen Interactive commentedThis is another issue I've been having regarding view modes, went ahead and wrote a patch as well.
Problem
When viewing the default block view page, the view mode selected is not being rendered and instead - always reverts to "Default".
Solution
Grab view mode from Bean object, supply it as an argument. If no view mode is available, fall back to default.
Comment #4
kyletaylored CreditAttribution: kyletaylored at LevelTen Interactive commentedComment #5
joelpittetThat seems very reasonable, thanks for the patch.
Comment #6
DamienMcKennaCommitted. Thanks all!