Skip to content

Commit

Permalink
EWPP-4805: Merge branch '4.x' into release-4.2.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
22Alexandra committed Nov 27, 2024
2 parents da07ac7 + 3b77a26 commit ef661a5
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 ef661a5

Please sign in to comment.