Posts

Showing posts from January, 2020

Free Drupal themes to look for

Themes https://www.drupal.org/project/bfd https://www.drupal.org/project/catalog_lite https://www.drupal.org/project/global_zymphonies_theme https://www.drupal.org/project/holy https://www.drupal.org/project/mili https://www.drupal.org/project/tara boostrap specific modules https://www.drupal.org/project/bootstrap_layouts

Programatically create layout builder section in Drupal

A sample script which can create a one column layout and store body field in it. namespace Drupal\custommodule\Controller; use Drupal\Core\Controller\ControllerBase; use Drupal\layout_builder\Section; use Drupal\layout_builder\SectionComponent; use Drupal\node\Entity\Node; use Drupal\block\Entity\Block; use Drupal\block_content\Entity\BlockContent; use Drupal\layout_builder\Entity; $entity = Node::load(10);     $section = new Section('layout_onecol');     $uuid = $entity->uuid();     $region = 'content';     $pluginConfiguration = [         'id' => 'field_block:node:article:body',         'provider' => 'layout_builder',         'label_display' => FALSE,         'view_mode' => 'default',         'entity' => $entity->id(),         'context_mapping' => [         ...