diff --git a/web/themes/custom/agarica/agarica.theme b/web/themes/custom/agarica/agarica.theme index d3b1480..fb83964 100644 --- a/web/themes/custom/agarica/agarica.theme +++ b/web/themes/custom/agarica/agarica.theme @@ -142,13 +142,8 @@ function agarica_languague_switch_link() { /** * Implements hook_preprocess_HOOK() for field__field_title template. */ -function agarica_preprocess_field__field_title(&$variables) { - $parentEntity = $variables['element']['#object']->getParentEntity(); - if ($parentEntity instanceof EntityInterface && $parentEntity->getEntityTypeId() === 'node') { - if (isset($parentEntity->getFields()['field_authors'])) { - - $variables['authors'] = $variables['element']['#object']->authors_html; - $variables['date'] = $variables['element']['#object']->date_html; - } - } +function agarica_preprocess_paragraph__title(&$variables) { + $field_title = $variables['content']['field_title']['#object']; + $variables['authors'] = $field_title->authors_html; + $variables['date'] = $field_title->date_html; }