diff --git a/src/Plugin/Layout/UwInvertedLRightLayout.php b/src/Plugin/Layout/UwInvertedLRightLayout.php new file mode 100644 index 0000000000000000000000000000000000000000..e0bd1f7a80511325142de12d7dc88aa1d5e604b4 --- /dev/null +++ b/src/Plugin/Layout/UwInvertedLRightLayout.php @@ -0,0 +1,38 @@ +<?php + +namespace Drupal\uw_cfg_common\Plugin\Layout; + +use Drupal\Core\Form\FormStateInterface; + +/** + * A UW Inverted L Right layout. + */ +class UwInvertedLRightLayout extends UwColumnLayoutBase { + + /** + * {@inheritdoc} + */ + public function buildConfigurationForm(array $form, FormStateInterface $form_state) { + + // Get the config for this layout. + $configuration = $this->getConfiguration(); + + // The options for the column widths. + $options = [ + 'even-split' => $this->t('Even split (50%, 50%)'), + 'larger-left' => $this->t('Larger left (33%, 67%)'), + 'larger-right' => $this->t('Larger right (67%, 33%)'), + ]; + + // The form element for the column widths. + $form['layout_settings']['column_class'] = [ + '#type' => 'select', + '#title' => $this->t('Column widths for top row'), + '#default_value' => !empty($configuration['column_class']) ? $configuration['column_class'] : 'even-split', + '#options' => $options, + ]; + + return $form; + } + +} diff --git a/uw_cfg_common.layouts.yml b/uw_cfg_common.layouts.yml index 2b84869c1f42488195df296f8fb3678cbf3ad86b..8b3ebe343b8a9810ce1c259dc6500c81bbc59257 100644 --- a/uw_cfg_common.layouts.yml +++ b/uw_cfg_common.layouts.yml @@ -71,4 +71,22 @@ uw_five_column: fifth: label: Fifth icon_map: - - [first, second, third, fourth, fifth] \ No newline at end of file + - [first, second, third, fourth, fifth] +uw_inverted_l_right: + label: 'Inverted "L" - right' + category: 'UW layouts' + class: '\Drupal\uw_cfg_common\Plugin\Layout\UwInvertedLRightLayout' + template: uw_fdsu_theme_resp/templates/layout/layout--invertedlright + default_region: first + regions: + first: + label: First + second: + label: Second + third: + label: Third + fourth: + label: Fourth + icon_map: + - [first, second, fourth] + - [third, third, fourth] \ No newline at end of file