Remove authoring details from title paragraph, to be displayed on every node with authors
This commit is contained in:
parent
25713e5d9c
commit
75e0bb9d21
1 changed files with 0 additions and 16 deletions
|
@ -18,22 +18,6 @@ function agarica_preprocess_node(&$variables) {
|
|||
$allowed_regions = ['secondary_menu'];
|
||||
agarica_add_regions_to_node($allowed_regions, $variables);
|
||||
}
|
||||
$field_body_paragraph = $variables['elements']['field_body_paragraph'] ?? NULL;
|
||||
if (isset($field_body_paragraph)) {
|
||||
$max_key = max(array_map('intval', array_keys($field_body_paragraph)));
|
||||
for ($i = 0; $i <= $max_key; $i++) {
|
||||
if ($field_body_paragraph[$i]['#paragraph']->getType() === 'title') {
|
||||
|
||||
$renderer = \Drupal::service('renderer');
|
||||
|
||||
$authors_html = $renderer->render($variables['content']['field_authors']);
|
||||
$date_html = $variables['date'];
|
||||
|
||||
$field_body_paragraph[$i]['#paragraph']->authors_html = $authors_html;
|
||||
$field_body_paragraph[$i]['#paragraph']->date_html = $date_html;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue