Skip to content

Commit

Permalink
Merge pull request #1501 from openeuropa/EWPP-4704
Browse files Browse the repository at this point in the history
EWPP-4704: Remove override of method getMetadata() for List Page cont…
  • Loading branch information
upchuk authored Nov 4, 2024
2 parents a22e892 + 0ae6b86 commit 3b77a26
Showing 1 changed file with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,4 @@ public function applies(): bool {
return $node && $node->bundle() === 'oe_list_page';
}

/**
* {@inheritdoc}
*/
public function getMetadata(): array {
$metadata = parent::getMetadata();

$node = $this->getNode();
if ($node->get('oe_summary')->isEmpty()) {
return $metadata;
}

$summary = $node->get('oe_summary')->first();
$metadata['introduction'] = [
// We strip the tags because the component expects only one paragraph of
// text and the field is using a text format which adds paragraph tags.
'#type' => 'inline_template',
'#template' => '{{ summary|render|striptags("<strong><a><em>")|raw }}',
'#context' => [
'summary' => [
'#type' => 'processed_text',
'#text' => $summary->value,
'#format' => $summary->format,
'#langcode' => $summary->getLangcode(),
],
],
];

return $metadata;
}

}

0 comments on commit 3b77a26

Please sign in to comment.