Skip to content

Commit

Permalink
Second attempt to fix externe link button
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamieljv committed Apr 21, 2024
1 parent 2b6fbdc commit e3896e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resources/views/acties/actie.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,12 @@ class="p-3 text-sm rounded-md alert-warning"
@foreach( $actie->externe_link as $externe_link )
<?php
preg_match( "/(http(s)?:[\\/]+)?([a-z0-9.\-_]+)[\\/]?/", strtolower($externe_link), $label );
if(substr( $externe_link, 0, 4) == 'http')
if(substr( $externe_link, 0, 4) != 'http') {
$externe_link = 'https://' . $externe_link;
}
?>
<a href="{{ $externe_link }}" target="_blank" class="w-full inline-flex items-center px-4 py-2 text-base font-medium leading-6 text-white whitespace-no-wrap transition duration-150 ease-in-out border border-transparent rounded-md bg-[color:var(--wkid-pink)] hover:bg-[color:var(--wkid-pink-dark)]">
@svg('antdesign-link-o', ['style' => 'width: 20px; height: 20px']) &nbsp; {{ $label == 1 ? $label[3] : $externe_link }}
@svg('antdesign-link-o', ['style' => 'width: 20px; height: 20px']) &nbsp; {{ $label ? $label[3] : $externe_link }}
</a>
@endforeach
</div>
Expand Down

0 comments on commit e3896e8

Please sign in to comment.