Use asset_current_location formatter for the asset location computed field.

This commit is contained in:
Paul Weidner 2022-06-17 16:05:32 -07:00 committed by Michael Stenta
parent 874dfad08b
commit badaf9680c
1 changed files with 9 additions and 2 deletions

View File

@ -23,8 +23,15 @@ function farm_location_asset_base_fields() {
'multiple' => TRUE,
'computed' => AssetLocationItemList::class,
'hidden' => 'form',
'weight' => [
'view' => 95,
'view_display_options' => [
'label' => 'inline',
'type' => 'asset_current_location',
'settings' => [
'link' => TRUE,
'render_without_location' => FALSE,
'move_asset_button' => FALSE,
],
'weight' => 95,
],
];
$fields['location'] = \Drupal::service('farm_field.factory')->baseFieldDefinition($options);