-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlocalgov_guides.install
33 lines (31 loc) · 1.01 KB
/
localgov_guides.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* @file
* Install, update and uninstall functions for the LocalGov Guides module.
*/
/**
* Implements hook_install().
*/
function localgov_guides_install($is_syncing) {
if ($is_syncing) {
return;
}
$services = \Drupal::moduleHandler()->moduleExists('localgov_services_navigation');
$topics = \Drupal::moduleHandler()->moduleExists('localgov_topics');
localgov_guides_optional_fields_settings($services, $topics);
// Check if simple_sitemap module is installed.
$simple_sitemap = \Drupal::moduleHandler()->moduleExists('simple_sitemap');
if ($simple_sitemap) {
// Install default config, as this does not appear to work in the
// config/optional folder.
$entity_manager = \Drupal::service('simple_sitemap.entity_manager');
$entity_manager->setBundleSettings('node', 'localgov_guides_overview', [
'index' => TRUE,
'priority' => 0.5,
]);
$entity_manager->setBundleSettings('node', 'localgov_guides_page', [
'index' => TRUE,
'priority' => 0.5,
]);
}
}