You are here

popup_onload.install in Popup On Load 8

Same filename and directory in other branches
  1. 7 popup_onload.install

Install, update and uninstall functions for the Popup onload module.

File

popup_onload.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Popup onload module.
 */
use Drupal\Core\Field\BaseFieldDefinition;

/**
 * Implements hook_update_N().
 *
 * Add new baseField for path.
 */
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);
}

Functions

Namesort descending Description
popup_onload_update_8001 Implements hook_update_N().