BaseTwoColumnsLayout.php in Layout Builder Base 8
File
modules/layout_builder_base_library/src/Plugin/Layout/BaseTwoColumnsLayout.php
View source
<?php
namespace Drupal\layout_builder_base_library\Plugin\Layout;
class BaseTwoColumnsLayout extends BaseMultipleColumnsLayout {
public function build(array $regions) {
$build = parent::build($regions);
$build['#attributes']['class'][] = 'layout-builder-base--two-columns';
return $build;
}
protected function getDefaultColumnWidth() {
$options = $this
->getColumnWidthOptions();
return $this
->getDefaultConfigOption('two_column_width', $options);
}
protected function getColumnWidthOptions() {
$options = [
'layout--column-width--default' => $this
->t('50% - 50%'),
'layout--column-width--33-67' => $this
->t('33% - 67%'),
'layout--column-width--67-33' => $this
->t('67% - 33%'),
'layout--column-width--25-75' => $this
->t('25% - 75%'),
'layout--column-width--75-25' => $this
->t('75% - 25%'),
];
$this->moduleHandler
->alter('layout_builder_base_two_column_width', $options);
return $options;
}
}