Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 74792da2 authored by drishu's avatar drishu
Browse files

OEL-1913: Improve carousel link processing.

parent 2f6873c0
No related branches found
No related tags found
1 merge request!179OEL-1913: Theme oe_carousel paragraph.
......@@ -520,18 +520,10 @@ function oe_whitelabel_preprocess_paragraph__oe_carousel(array &$variables): voi
if (!$sub_paragraph->get('field_oe_link')->isEmpty()) {
/** @var \Drupal\link\Plugin\Field\FieldType\LinkItem $link_item */
$link_item = $sub_paragraph->get('field_oe_link')->first();
$link = Url::fromUri($link_item->get('uri')->getValue())->toString();
$link_text = $link_item->get('title')->getValue();
$slide['link'] = [
'label' => $link_text ?? '',
'path' => $link ?? '',
'icon_position' => 'before',
'icon' => [
'name' => 'link',
'path' => $variables['bcl_icon_path'],
],
$link_item = $paragraph->get('field_oe_link')->first();
$variables['link'] = [
'path' => $link_item->getUrl()->toString(),
'label' => $link_item->get('title')->getValue(),
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment