diff --git a/config/install/core.entity_view_mode.node.localgov_card.yml b/config/install/core.entity_view_mode.node.localgov_card.yml new file mode 100644 index 0000000..f66f7aa --- /dev/null +++ b/config/install/core.entity_view_mode.node.localgov_card.yml @@ -0,0 +1,10 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.localgov_card +label: 'LocalGov Card' +description: '' +targetEntityType: node +cache: true diff --git a/localgov_core.install b/localgov_core.install index 6168e57..29f935f 100644 --- a/localgov_core.install +++ b/localgov_core.install @@ -57,3 +57,19 @@ function localgov_core_update_8002() { } } } + +/** + * Add a localgov_card view mode. + */ +function localgov_core_update_8003() { + $view_mode = \Drupal::entityTypeManager()->getStorage('entity_view_mode')->load('node.localgov_card'); + if (!$view_mode) { + $view_mode = \Drupal::entityTypeManager()->getStorage('entity_view_mode')->create([ + 'id' => 'node.localgov_card', + 'targetEntityType' => 'node', + 'status' => TRUE, + 'label' => 'LocalGov Card', + ]); + $view_mode->save(); + } +}