Skip to content
Snippets Groups Projects
Unverified Commit a997779d authored by Alex Pott's avatar Alex Pott
Browse files

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
parent 84b1d18b
No related branches found
No related tags found
No related merge requests found
......@@ -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',
}
%}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment