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.
There is no way to select the 'default' view mode of an entity when using the entity_reference field. There should *always* be a 'default' option by default.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2035697-entity-reference-formatter-default-view-mode.patch | 1.62 KB | Dave Reid |
Comments
Comment #1
Dave ReidComment #2
Dave ReidCorresponding contrib module issue: #2035699: Unable to select the 'Default' view mode in the field formatter
Comment #3
amateescu CreditAttribution: amateescu commentedAgreed :)
Comment #4
olli CreditAttribution: olli commentedDo you think we should make 'Default' view mode available also in custom blocks, views entity area and row plugins (in follow-ups)?
I'm not sure if this would be more readable as:
Comment #5
alexpottCommitted 6023052 and pushed to 8.x. Thanks!
Comment #7
olli CreditAttribution: olli commentedFiled #2057199: Unable to select the 'Default' view mode for custom block, #2057203: Unable to select the 'Default' view mode in views entity area handler and #2057207: Unable to select the 'Default' view mode in views entity row plugin.
Comment #8
Dave ReidI'm starting to wonder if entity_get_view_modes() should always include a 'default' => array('label' => t('Default')) in it's return value...
Comment #9
olli CreditAttribution: olli commentedHmm. Found this saying:
Also: the default value for view mode is "full" here, but not all entity types have it.
So instead of providing the 'Default', what about providing the 'Full'? Or should we just change the docs by removing "is not intended for actual entity display, but" and maybe change the default value from "full" to "default"?
Comment #10
Dave ReidThat documentation is in my opinion, wrong. Default view mode is perfectly valid for display.