diff --git a/web/themes/custom/quartiers_de_demain/quartiers_de_demain.theme b/web/themes/custom/quartiers_de_demain/quartiers_de_demain.theme index 0e1a0af..0f86939 100644 --- a/web/themes/custom/quartiers_de_demain/quartiers_de_demain.theme +++ b/web/themes/custom/quartiers_de_demain/quartiers_de_demain.theme @@ -35,12 +35,41 @@ function quartiers_de_demain_preprocess_page(&$variables) { * Implements hook_preprocess_HOOK() for node.html.twig. */ function quartiers_de_demain_preprocess_node(&$variables) { - $node = &$variables['node']; - $variables['attributes']['class'][] = 'node-type-' . $node->gettype(); + $node = &$variables['node']; + $variables['attributes']['class'][] = 'node-type-' . $node->gettype(); + + if ($node->getType() === 'actualite' + && $variables['view_mode'] === 'full' + && $node->hasField('body')) { + + $summary = $node->get('body')->summary; + $full = $node->get('body')->value; + + if (!empty($summary) || !empty($full)) { + $variables['content']['body'] = [ + '#type' => 'inline_template', + '#template' => ' + {% if summary %} +