diff --git a/source/php/Component/Segment/Segment.php b/source/php/Component/Segment/Segment.php index d43a1889..0ac9ee50 100644 --- a/source/php/Component/Segment/Segment.php +++ b/source/php/Component/Segment/Segment.php @@ -33,7 +33,8 @@ public function init() // If no link and exactly one button, use that button as link if (!$link && ($buttons && count($buttons) === 1)) { - $this->data['link'] = $buttons[0]['href']; + $this->data['link']['url'] = $buttons[0]['href']; + $this->data['link']['ariaLabel'] = $buttons[0]['text']; } if (!empty($hasPlaceholderImage)) { diff --git a/source/php/Component/Segment/components/content.blade.php b/source/php/Component/Segment/components/content.blade.php index be1dea91..c03e4a14 100644 --- a/source/php/Component/Segment/components/content.blade.php +++ b/source/php/Component/Segment/components/content.blade.php @@ -19,7 +19,7 @@ 'autopromote' => true ]) @link([ - 'href' => $link, + 'href' => $link['url'], 'keepContent' => true, 'keepWrapper' => false ]) diff --git a/source/php/Component/Segment/components/image.blade.php b/source/php/Component/Segment/components/image.blade.php index 7dcb95ea..bdac7591 100644 --- a/source/php/Component/Segment/components/image.blade.php +++ b/source/php/Component/Segment/components/image.blade.php @@ -1,8 +1,11 @@ @link([ - 'href' => $link, + 'href' => $link['url'], 'classList' => ['c-segment__image'], 'keepContent' => true, - 'keepWrapper' => false + 'keepWrapper' => false, + 'attributeList' => [ + 'aria-label' => $link['ariaLabel'], + ] ])
@endlink