FIX: Update link target attributes for external links in page header
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2026-05-21 16:07:07 +02:00
parent a99afd1b6c
commit 8840e4a2a3
3 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
.entry-content,
.site-content {
a[target='_blank'] {
a[target='_blank']:not(.page-header__cta) {
@apply external-link;
}
}

View File

@ -6,6 +6,7 @@ $description = $args['description'];
$cover = $args['cover'];
$background_style = $args['background_style'] ?? 'normal';
$cta = $args['cta'];
$target = $cta['target'] ?? '_self';
$has_overlap = $args['has_overlap'] ?? false;
?>
@ -20,7 +21,7 @@ $has_overlap = $args['has_overlap'] ?? false;
<p class="page-header__description"><?php echo $description; ?></p>
<?php endif; ?>
<?php if ($cta) : ?>
<a href="<?php echo $cta['url']; ?>" class="page-header__cta"><?php echo $cta['title']; ?></a>
<a href="<?php echo $cta['url']; ?>" target="<?php echo $target; ?>" class="page-header__cta"><?php echo $cta['title']; ?></a>
<?php endif; ?>
</div>

View File

@ -9,6 +9,7 @@
'has_overlap' => false,
'background_style' => 'sliced',
'cta' => array(
'target' => '_blank',
'title' => __('Consulter notre politique de collecte', 'carhop'),
'url' => 'https://carhop.be/wp-content/uploads/2026/03/carhop-depot-politique-collecte-fev-2026_compressed.pdf',
)