You are here

function popup_onload_update_8001 in Popup On Load 8

Implements hook_update_N().

Add new baseField for path.

File

./popup_onload.install, line 16
Install, update and uninstall functions for the Popup onload module.

Code

function popup_onload_update_8001() {
  $field_storage_definition = BaseFieldDefinition::create('string')
    ->setLabel(t('Display only at specified path'))
    ->setDescription(t('Specify page by using their path start with /. Leave empty to include all pages.'))
    ->setDefaultValue('')
    ->setDisplayOptions('form', array(
    'type' => 'string_textfield',
    'weight' => 12,
  ));
  \Drupal::entityDefinitionUpdateManager()
    ->installFieldStorageDefinition('path', 'popup_onload', 'popup_onload', $field_storage_definition);
}