Skip to content

Commit

Permalink
add link to gallery mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bastihilger committed Dec 6, 2023
1 parent dbd0a9d commit ec5a4a4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/TiptapContentBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,22 @@ class="ttcp-grid-image"
$html = '<div class="ttcp-slideshow-wrapper"><div class="ttcp-slideshow-inner"><div id="swiper_' . Str::random(12) . '" class="swiper"><div class="swiper-wrapper">';

foreach ($slides as $slide) {
$embedCode = '';
if (@$slide->embedCode && stristr($slide->embedCode, '<iframe')) {
$embedCode = $slide->embedCode;
}

$html .= '<div class="ttcp-slideshow-slide swiper-slide">';
$html .= '<div class="ttcp-slideshow-image-wrapper"><div class="ttcp-slideshow-image-inner">';

if (@$slide->link && !$embedCode) {
$html .= '<a href="' . $slide->link . '"';
if (@$slide->linkTarget) {
$html .= ' target="' . $slide->linkTarget . '" ';
}
$html .= '>';
}

if ($this->isVideo($slide->src)) {
$html .= '<video
autoplay muted loop playsinline
Expand All @@ -105,6 +118,10 @@ class="ttcp-slideshow-image"
$html .= '<img class="ttcp-slideshow-image" src="' . $slide->src . '" />';
}

if (@$slide->link && !$embedCode) {
$html .= '</a>';
}

$html .= '<div class="ttcp-slideshow-subtext">';
$html .= '<div class="ttcp-slideshow-caption">' . $slide->caption . '</div>';
$html .= '<div class="ttcp-slideshow-credits">' . $slide->credits . '</div>';
Expand Down

0 comments on commit ec5a4a4

Please sign in to comment.