cms_blog.install in Glazed CMS Blog 8
Same filename and directory in other branches
Install, update and uninstall functions for the CMS Blog module.
File
cms_blog.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the CMS Blog module.
*/
use Drupal\block\Entity\Block;
/**
* Implements hook_install().
*/
function cms_blog_install() {
$default_theme = Drupal::config('system.theme')
->get('default');
$defaults = [
'theme' => $default_theme,
'status' => TRUE,
'region' => 'sidebar_second',
'visibility' => [
'request_path' => [
'id' => 'request_path',
'pages' => implode("\n", [
'/blog',
'/blog/*',
'/tags/*',
]),
'negate' => FALSE,
],
],
'dependencies' => [
'enforced' => [
'module' => [
'cms_blog',
],
],
],
];
Block::create($defaults + [
'id' => 'views_block.cms_blog_authors_block',
'plugin' => 'views_block:cms_blog_authors-block',
'settings' => [
'id' => 'views_block:cms_blog_authors_block',
'label' => '',
'provider' => 'views',
'label_display' => 'visible',
'views_label' => '',
'items_per_page' => 'none',
],
])
->save();
Block::create($defaults + [
'id' => 'cms_blog_tags',
'plugin' => 'tagclouds_block:cms_blog_tags',
'settings' => [
'id' => 'tagclouds_block:cms_blog_tags',
'label' => 'Tags',
'provider' => 'tagclouds',
'label_display' => 'visible',
'tags' => 12,
'vocabulary' => 'cms_blog_tags',
],
])
->save();
Block::create($defaults + [
'id' => 'views_block.cms_blog_categories_block',
'plugin' => 'views_block:cms_blog_categories-block',
'settings' => [
'id' => 'views_block:cms_blog_categories_block',
'label' => '',
'provider' => 'views',
'label_display' => 'visible',
'views_label' => '',
'items_per_page' => 'none',
],
])
->save();
}
Functions
Name | Description |
---|---|
cms_blog_install | Implements hook_install(). |