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

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

/**
 * @file
 * Install file for wxt_ext_sitemap.
 */

use Drupal\node\Entity\NodeType;

/**
 * Implements hook_install().
 */
function wxt_ext_sitemap_install() {
  $enabled_bundles = [
    'page',
  ];
  $sitemap_config = [];
  foreach ($enabled_bundles as $bundle_name) {
    // Enable the sitemap only for bundles the user has chosen to install.
    if (NodeType::load($bundle_name) === NULL) {
      continue;
    }
    $sitemap_config['node'][$bundle_name] = [
      'index' => 1,
      'priority' => '0.5',
    ];
  }
  \Drupal::service('config.factory')
    ->getEditable('simple_sitemap.settings')
    ->set('entity_types', $sitemap_config)
    ->save();
}

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

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