forked from forkcms/forkcms
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update media gallery styling #367
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -104,5 +104,9 @@ | |
}, | ||
"volta": { | ||
"node": "18.13.0" | ||
}, | ||
"dependencies": { | ||
"@splidejs/splide": "^4.1.4", | ||
"fslightbox": "^3.4.1" | ||
} | ||
} |
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,58 +1,58 @@ | ||
/** | ||
* global: jsFrontend | ||
*/ | ||
(function ($) { | ||
/** | ||
* Create responsive media slider, which uses "slick" slider | ||
*/ | ||
$.fn.mediaLibrarySlider = function () { | ||
// loop for all sliders | ||
return this.each(function () { | ||
// define slider | ||
var $slider = $(this) | ||
|
||
// define show controls or not | ||
var showControls = $slider.data('show-controls') | ||
var showPager = $slider.data('show-pager') | ||
|
||
// we have multiple items | ||
var multipleItems = ($slider.find('div').length > 1) | ||
|
||
// we only have one item, hide controls | ||
if (!multipleItems) { | ||
showControls = false | ||
showPager = false | ||
} | ||
|
||
// init slick slider | ||
$slider.find('.widget-body').show().slick({ | ||
arrows: showControls, | ||
autoplay: multipleItems, | ||
adaptiveHeight: true, | ||
dots: showPager, | ||
// fade: true, // this has side effects in bootstrap 4 because of the .fade class, if you enable this don't forget to add extra styling for this | ||
lazyLoad: 'ondemand', | ||
mobileFirst: true | ||
}) | ||
}) | ||
} | ||
})(jQuery) | ||
|
||
/** | ||
* MediaLibrary slider | ||
*/ | ||
jsFrontend.mediaLibrarySlider = { | ||
init: function () { | ||
var $sliders = $('.widget-media-library-slider') | ||
|
||
// when no items for slider found, stop here | ||
if ($sliders.length === 0) { | ||
return false | ||
} | ||
|
||
// init sliders | ||
$sliders.mediaLibrarySlider() | ||
} | ||
} | ||
|
||
$(jsFrontend.mediaLibrarySlider.init) | ||
// /** | ||
// * global: jsFrontend | ||
// */ | ||
// (function ($) { | ||
// /** | ||
// * Create responsive media slider, which uses "slick" slider | ||
// */ | ||
// $.fn.mediaLibrarySlider = function () { | ||
// // loop for all sliders | ||
// return this.each(function () { | ||
// // define slider | ||
// var $slider = $(this) | ||
// | ||
// // define show controls or not | ||
// var showControls = $slider.data('show-controls') | ||
// var showPager = $slider.data('show-pager') | ||
// | ||
// // we have multiple items | ||
// var multipleItems = ($slider.find('div').length > 1) | ||
// | ||
// // we only have one item, hide controls | ||
// if (!multipleItems) { | ||
// showControls = false | ||
// showPager = false | ||
// } | ||
// | ||
// // init slick slider | ||
// $slider.find('.widget-body').show().slick({ | ||
// arrows: showControls, | ||
// autoplay: multipleItems, | ||
// adaptiveHeight: true, | ||
// dots: showPager, | ||
// // fade: true, // this has side effects in bootstrap 4 because of the .fade class, if you enable this don't forget to add extra styling for this | ||
// lazyLoad: 'ondemand', | ||
// mobileFirst: true | ||
// }) | ||
// }) | ||
// } | ||
// })(jQuery) | ||
// | ||
// /** | ||
// * MediaLibrary slider | ||
// */ | ||
// jsFrontend.mediaLibrarySlider = { | ||
// init: function () { | ||
// var $sliders = $('.widget-media-library-slider') | ||
// | ||
// // when no items for slider found, stop here | ||
// if ($sliders.length === 0) { | ||
// return false | ||
// } | ||
// | ||
// // init sliders | ||
// $sliders.mediaLibrarySlider() | ||
// } | ||
// } | ||
// | ||
// $(jsFrontend.mediaLibrarySlider.init) |
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
35 changes: 35 additions & 0 deletions
35
src/Frontend/Themes/Bootstrap/Modules/MediaLibrary/Layout/Widgets/Lightbox.html.twig
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% if mediaItems %} | ||
<section class="module-media-library" itemscope itemtype="http://schema.org/ImageGallery"> | ||
{% block widget_heading %} | ||
{# {% if title %}#} | ||
{# <header class="widget-heading">#} | ||
{# <h3>{{ title|ucfirst }}</h3>#} | ||
{# </header>#} | ||
{# {% endif %}#} | ||
{% endblock %} | ||
{% block widget_body %} | ||
<div class="widget-body"> | ||
<div class="grid-container grid-masonry"> | ||
{% for mediaItem in mediaItems %} | ||
<div class="grid-item"> | ||
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject"> | ||
{% set img = mediaItem.webpath() %} | ||
<a href="{{ (mediaItem.getWebPath()) | imagine_filter('media_library_lightbox_large') }}" itemprop="contentUrl" data-size="{{ mediaItem.width }}x{{ mediaItem.height }}" data-fslightbox="gallery-lightbox" data-caption="{{ mediaItem.title }}"> | ||
<img itemprop="thumbnail" src="{{ (mediaItem.getWebPath()) | imagine_filter('media_library_lightbox_small') }}" alt="{{ mediaItem.title }}" /> | ||
</a> | ||
{# <figcaption itemprop="caption description">{% if title %}{{ title }}{% endif %}{% if not title %}{{ mediaItem.title }}{% endif %}</figcaption>#} | ||
{% if mediaItem.type == 'movie' %} | ||
<div class="hidden" data-lightbox="html"> | ||
{{ mediaItem.getIncludeHTML()|raw }} | ||
</div> | ||
{% endif %} | ||
</figure> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block widget_footer %}{% endblock %} | ||
</section> | ||
{% endif %} |
30 changes: 30 additions & 0 deletions
30
src/Frontend/Themes/Bootstrap/Modules/MediaLibrary/Layout/Widgets/Listing.html.twig
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{# | ||
Media Listing | ||
Variables that are available: | ||
- {{ mediaItems }}: Contains full urls to MediaItem items, f.e.: {{ items.source }} | ||
- {{ title }}: A custom optional title that you can give when parsing from Custom module. | ||
#} | ||
|
||
{% if mediaItems %} | ||
<section class="module-media-library widget-media-library-listing"> | ||
{% block widget_heading %} | ||
{% if title %} | ||
<header class="widget-heading"> | ||
<h3>{{ title|ucfirst }}</h3> | ||
</header> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block widget_body %} | ||
<div class="widget-body"> | ||
<ul> | ||
{% for mediaItem in mediaItems %} | ||
<li>{{ mediaItem.getLinkHTML|raw }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block widget_footer %}{% endblock %} | ||
</section> | ||
{% endif %} |
32 changes: 32 additions & 0 deletions
32
src/Frontend/Themes/Bootstrap/Modules/MediaLibrary/Layout/Widgets/OneImage.html.twig
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{# | ||
Media Slider with BxSlider | ||
Variables that are available: | ||
- {{ mediaItem }}: Contains the MediaItem | ||
- {{ title }}: A custom optional title that you can give when parsing from Custom module. | ||
#} | ||
|
||
{% if mediaItem %} | ||
<section class="module-media-library widget-media-library-one-image" itemscope itemtype="http://schema.org/ImageGallery"> | ||
{% block widget_heading %} | ||
{% if title %} | ||
<header class="widget-heading"> | ||
<h3>{{ title|ucfirst }}</h3> | ||
</header> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block widget_body %} | ||
<div class="widget-body"> | ||
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject"> | ||
{% if mediaItem.type == 'movie' %} | ||
{{ mediaItem.getIncludeHTML()|raw }} | ||
{% else %} | ||
<img itemprop="thumbnail" class="img-polaroid img-responsive" src="{{ (mediaItem.getWebPath('media_library_one_image_large')) }}" alt="{{ mediaItem.title }}" /> | ||
{% endif %} | ||
</figure> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block widget_footer %}{% endblock %} | ||
</section> | ||
{% endif %} |
32 changes: 32 additions & 0 deletions
32
src/Frontend/Themes/Bootstrap/Modules/MediaLibrary/Layout/Widgets/OneRandomImage.html.twig
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{# | ||
Media Slider with BxSlider | ||
Variables that are available: | ||
- {{ mediaItem }}: Contains the MediaItem | ||
- {{ title }}: A custom optional title that you can give when parsing from Custom module. | ||
#} | ||
|
||
{% if mediaItem %} | ||
<section class="module-media-library widget-media-library-one-random-image" itemscope itemtype="http://schema.org/ImageGallery"> | ||
{% block widget_heading %} | ||
{% if title %} | ||
<header class="widget-heading"> | ||
<h3>{{ title|ucfirst }}</h3> | ||
</header> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block widget_body %} | ||
<div class="widget-body"> | ||
<figure itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject"> | ||
{% if mediaItem.type == 'movie' %} | ||
{{ mediaItem.getIncludeHTML()|raw }} | ||
{% else %} | ||
<img itemprop="thumbnail" class="img-polaroid img-responsive" src="{{ (mediaItem.getWebPath('media_library_one_image_large')) }}" itemprop="thumbnail" alt="{{ mediaItem.title }}" /> | ||
{% endif %} | ||
</figure> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block widget_footer %}{% endblock %} | ||
</section> | ||
{% endif %} |
42 changes: 42 additions & 0 deletions
42
src/Frontend/Themes/Bootstrap/Modules/MediaLibrary/Layout/Widgets/Slider.html.twig
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{# | ||
Media Slider with BxSlider | ||
Variables that are available: | ||
- {{ mediaItems }}: Contains the MediaItem items | ||
- {{ title }}: A custom optional title that you can give when parsing from Custom module. | ||
#} | ||
|
||
{% if mediaItems %} | ||
<section class="module-media-library widget-media-library-slider" data-show-controls="true" data-show-pager="true" itemscope itemtype="http://schema.org/ImageGallery"> | ||
{% block widget_heading %} | ||
{% if title %} | ||
<header class="widget-heading"> | ||
<h3>{{ title|ucfirst }}</h3> | ||
</header> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block widget_body %} | ||
<div class="widget-body splide" data-role="slider"> | ||
<div class="splide__track"> | ||
<ul class="splide__list"> | ||
{% for mediaItem in mediaItems %} | ||
<li class="splide__slide"> | ||
<div itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject"> | ||
{% if mediaItem.type == 'movie' %} | ||
{{ mediaItem.getIncludeHTML()|raw }} | ||
{% else %} | ||
<a href="{{ (mediaItem.getWebPath()) | imagine_filter('media_library_lightbox_large') }}" itemprop="contentUrl" data-size="{{ mediaItem.width }}x{{ mediaItem.height }}" data-fslightbox="{{ title }}-slider-lightbox" data-caption="{{ mediaItem.title }}"> | ||
<img itemprop="thumbnail" src="{{ (mediaItem.getWebPath()) | imagine_filter('media_library_lightbox_small') }}" alt="{{ mediaItem.title }}" /> | ||
</a> | ||
{% endif %} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block widget_footer %}{% endblock %} | ||
</section> | ||
{% endif %} |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waarom in comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vergeten, file verwijderd