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