wxt-8.x-3.011/modules/custom/wxt_ext/wxt_ext_landing_page/wxt_ext_landing_page.install

modules/custom/wxt_ext/wxt_ext_landing_page/wxt_ext_landing_page.install
<?php

/**
 * @file
 * Set up the WxT Extend Landing Page module.
 */

use Drupal\layout_builder\Entity\LayoutEntityDisplayInterface;

/**
 * Implements hook_install().
 */
function wxt_ext_landing_page_install() {
  // Stop here during a config sync.
  if (Drupal::isConfigSyncing()) {
    return;
  }

  $display = wxt_ext_layout_entity_get_display('node', 'landing_page', 'full');
  if (!($display instanceof LayoutEntityDisplayInterface)) {
    throw new \InvalidArgumentException('Expected the ' . $display->label() . ' display to support Layout Builder.');
  }
  $display->setOverridable()->save();

  $modules = [
    'layout_library',
    'wxt_ext_workflow',
    'menu_ui',
  ];

  $modules = array_filter($modules, [Drupal::moduleHandler(), 'moduleExists']);
  if ($modules) {
    wxt_ext_landing_page_modules_installed($modules);
  }

  // Enable translation for our core entities/bundles.
  $entities = [
    'node' => [
      'landing_page',
    ],
  ];
  wxt_translation_enable_translation($entities);
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc