diff --git a/bootstrap_barrio.layouts.yml b/bootstrap_barrio.layouts.yml index f6565f567c3cd2e27ea7a267d62d857b4a87d2ff..c3eee859a35e640ec7901cafea58065820c3ad2f 100644 --- a/bootstrap_barrio.layouts.yml +++ b/bootstrap_barrio.layouts.yml @@ -50,3 +50,13 @@ bb_card3stack: label: Image third: label: Second +bb_media: + label: Media + category: Barrio + template: templates/ds/layout--ds-media + class: '\Drupal\ds\Plugin\DsLayout' + regions: + first: + label: Image + second: + label: Content diff --git a/bootstrap_barrio.theme b/bootstrap_barrio.theme index 52983636df5679de8aa15be1c60ac171ce124ebc..281f75c67f5547163a747ee12cc11af8506d0a1f 100644 --- a/bootstrap_barrio.theme +++ b/bootstrap_barrio.theme @@ -310,14 +310,16 @@ function bootstrap_barrio_preprocess_block(&$variables) { } function bootstrap_barrio_preprocess_form_element(&$variables) { - if ( is_object($variables['label']['#title']) && !$variables['label']['#title'] instanceof \Drupal\Component\Render\MarkupInterface) { - $variables['input_title'] = NULL; - } - elseif ( is_object($variables['label']['#title']) ) { - $variables['input_title'] = $variables['label']['#title']; - } - else { - $variables['input_title'] = $variables['label']['#title']; + if (isset($variables['label']['#title'])) { + if ( is_object($variables['label']['#title']) && !$variables['label']['#title'] instanceof \Drupal\Component\Render\MarkupInterface) { + $variables['input_title'] = NULL; + } + elseif ( is_object($variables['label']['#title']) ) { + $variables['input_title'] = $variables['label']['#title']; + } + else { + $variables['input_title'] = $variables['label']['#title']; + } } if (isset($variables['element']['#attributes'])) { $variables['input_attributes'] = new Attribute($variables['element']['#attributes']); diff --git a/templates/content/page-title.html.twig b/templates/content/page-title.html.twig index adec853e2a3b5b00a4edb818eb70e7ed0e028886..0d94062ad9bdd5937af891ed7de4f9393b29ac8e 100644 --- a/templates/content/page-title.html.twig +++ b/templates/content/page-title.html.twig @@ -16,6 +16,6 @@ #} {{ title_prefix }} {% if title %} - <h1{{ title_attributes.addClass('page-title') }}>{{ title }}</h1> + <h1{{ title_attributes.addClass('title') }}>{{ title }}</h1> {% endif %} {{ title_suffix }} diff --git a/templates/ds/layout--ds-media.html.twig b/templates/ds/layout--ds-media.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..3e330fa13a5b234feee4336749b712d5597963e4 --- /dev/null +++ b/templates/ds/layout--ds-media.html.twig @@ -0,0 +1,27 @@ +{# +/** + * @file + * Display Suite media. + * + * Available variables: + * - outer_wrapper: outer wrapper element + * - first_wrapper: wrapper element around first region + * - second_wrapper: wrapper element around second region + * - attributes: layout attributes + * - first_attributes: attributes for first region + * - second_attributes: attributes for second region + * - first: content of first region + * - second: content of second region + */ +#} +<{{ outer_wrapper }}{{ attributes.addClass('media', 'clearfix') }}> + + {{ title_suffix.contextual_links }} + + {{ first }} + + <{{ second_wrapper }}{{ second_attributes.addClass('media-body') }}> + {{ second }} + </{{ second_wrapper }}> + +</{{ outer_wrapper }}> diff --git a/templates/layout/page-title.html.twig b/templates/layout/page-title.html.twig deleted file mode 100644 index e061cd2e0195efe3849a08333fb38a2cd4bdd5cb..0000000000000000000000000000000000000000 --- a/templates/layout/page-title.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "@classy/content/page-title.html.twig" %} -{# -/** - * @file - * Bartik's theme implementation for a page title. - * - * Available variables: - * - title_attributes: HTML attributes for the page title element. - * - title_prefix: Additional output populated by modules, intended to be - * displayed in front of the main title tag that appears in the template. - * - title: The page title, for use in the actual content. - * - title_suffix: Additional output populated by modules, intended to be - * displayed after the main title tag that appears in the template. - */ -#} -{% set title_attributes = title_attributes.addClass('title') %} diff --git a/templates/layout/page.html.twig b/templates/layout/page.html.twig index 19052c7f6c99af7a929d86a30ae7e56443cea6f8..5e1e96ba744b0d73378278d50b2f02eaa1693e0f 100644 --- a/templates/layout/page.html.twig +++ b/templates/layout/page.html.twig @@ -135,9 +135,7 @@ {% block content %} <div id="main" class="{{ container }}"> {% if page.breadcrumb %} - <div class="row"> - {{ page.breadcrumb }} - </div> + {{ page.breadcrumb }} {% endif %} <div class="row row-offcanvas row-offcanvas-left clearfix"> <main{{ content_attributes }}>