Skip to content

Commit

Permalink
EWPP-4704: Remove override of method getMetadata() for List Page cont…
Browse files Browse the repository at this point in the history
…ent type.
  • Loading branch information
sergepavle committed Sep 18, 2024
1 parent f7e2ece commit 3d0121f
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 3d0121f

Please sign in to comment.