diff --git a/core/themes/olivero/olivero.theme b/core/themes/olivero/olivero.theme index 1c2e9a7b535215ee50ab3689d17a62f4516b9e52..38ae150e7afdf72059e50751266b2fefbdf27e82 100644 --- a/core/themes/olivero/olivero.theme +++ b/core/themes/olivero/olivero.theme @@ -100,6 +100,13 @@ function olivero_preprocess_node(&$variables) { if (!empty($variables['date']) && !empty($variables['display_submitted']) && $variables['display_submitted'] === TRUE) { $variables['date'] = \Drupal::service('date.formatter')->format($variables['node']->getCreatedTime(), 'olivero_medium'); } + + // Pass layout variable to template if content type is article in full view + // mode. This is then used in the template to create a BEM style CSS class to + // control the layout. + if ($variables['node']->bundle() === 'article' && $variables['view_mode'] === 'full') { + $variables['layout'] = 'content-narrow'; + } } /** diff --git a/core/themes/olivero/templates/content/node--article--full.html.twig b/core/themes/olivero/templates/content/node--article--full.html.twig deleted file mode 100644 index 55c0ae9db182eacdf161cdfbccc8e0469df9ebc6..0000000000000000000000000000000000000000 --- a/core/themes/olivero/templates/content/node--article--full.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{# -/** - * @file - * Olivero's theme implementation for an article content type's full view mode. - */ - #} -{% include '@olivero/content/node.html.twig' with - { - 'layout': 'content-narrow', - } -%}