Commit d9d025a6 authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-3667 Move creating a home page from uw_sites_all to uw_ct_web_page

parent cb6f7c3b
<?php
/**
* @file
* Install, update and uninstall for uWaterloo Site Controller.
*/
use Drupal\node\Entity\Node;
use Drupal\pathauto\PathautoState;
/**
* Implements hook_install().
*/
function uw_sites_all_install() {
\Drupal::service('theme_installer')->install(['uw_fdsu_theme_resp']);
\Drupal::service('theme_handler')->setDefault('uw_fdsu_theme_resp');
\Drupal::configFactory()->getEditable('node.settings')->set('use_admin_theme', TRUE)->save(TRUE);
// Create a Home web page with alias 'home'.
$node = Node::create([
'type' => 'uw_ct_web_page',
'langcode' => 'en',
'uid' => 1,
'title' => 'Home',
'status' => 1,
'path' => [
'alias' => '/home',
'pathauto' => PathautoState::SKIP,
],
]);
$node->save();
// Set the front page to 'home'.
\Drupal::configFactory()
->getEditable('system.site')
->set('page.front', '/home')
->save();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment