-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render non-browser-native images in gallery
We'll include these in the gallery when we have thumbnails for them and they're of an image/* mimetype, but they're not in the whitelist as being browser-supported; these will get rendered by showing the "large" thumbnail image. Alongside this there's some cleanup/refactoring to the lightgallery helper, and a change to the gallery block for media to make it only use the gallery when the gallery supports the media being viewed, otherwise falling back to the standard embed. (fix #2068)
- Loading branch information
1 parent
af29fd9
commit 8e981a7
Showing
3 changed files
with
47 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
application/view/common/resource-page-block-layout/lightbox-gallery-media.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
<?php | ||
$media = $resource; | ||
$mediaType = $media->mediaType(); | ||
?> | ||
<?php echo $this->lightGalleryOutput([['media' => $media]]); ?> | ||
$sortedMedia = $this->sortMedia([$media]); | ||
|
||
if (isset($sortedMedia['lightMedia'])): | ||
echo $this->lightGalleryOutput($sortedMedia['lightMedia']); | ||
else: | ||
echo $this->partial('common/resource-page-block-layout/media-render'); | ||
endif; |