Unverified Commit 9bc87858 authored by alexpott's avatar alexpott

Issue #3142857 by mherchel, sulfikar_s, anmolgoyal74, kostyashupenko, Abhijith...

Issue #3142857 by mherchel, sulfikar_s, anmolgoyal74, kostyashupenko, Abhijith S, proeung, DuneBL: Refactor Olivero's usage of layout CSS class in node--article--full

(cherry picked from commit a997779d)
parent 6ab8e5e6
......@@ -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';
}
}
/**
......
{#
/**
* @file
* Olivero's theme implementation for an article content type's full view mode.
*/
#}
{% include '@olivero/content/node.html.twig' with
{
'layout': 'content-narrow',
}
%}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment