Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tranduyhung committed Nov 9, 2017
1 parent 1901b40 commit fa9b6d7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# v1.3.0
## 09/11/2017

1. [](#improved)
* Added ability to select gallery's full image via image dropdown list
* Removed gallery's thumbnail image
* Added 2 options for gallery thumbnail's max width and max height
* Gallery's thumbnail image is automatically resized from full image based on defined max width and max height values

# v1.2.0
## 05/11/2017

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Big Picture
description: "Grav Theme based on Big Picture HTML theme of html5up.net."
version: 1.2.0
version: 1.3.0
icon: photo
author:
name: Hung Tran
Expand Down
28 changes: 22 additions & 6 deletions blueprints/modular/gallery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ form:
type: tab
title: Images
fields:
header.thumbnail_max_width:
type: text
size: x-small
label: Thumbnail's Max Width
help: Min value 360, max value 1000.
default: 540
validate:
type: int
min: 360
max: 1000
header.thumbnail_max_height:
type: text
size: x-small
label: Thumbnail's Max Height
help: Min value 360, max value 1000.
default: 540
validate:
type: int
min: 360
max: 1000
header.images:
name: images
type: list
Expand All @@ -23,15 +43,11 @@ form:
label: Title
help: Image's title.
.full:
type: text
label: Full Image
help: Full image's filename.
.thumbnail:
type: filepicker
folder: '@self'
preview_images: true
accept:
- .png
- .jpg
label: Thumbnail
help: Thumbnail's filename.
label: Full Image
help: Full image's filename.
12 changes: 11 additions & 1 deletion templates/modular/gallery.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{% set thumbWidth = page.header.thumbnail_max_width %}
{% set thumbHeight = page.header.thumbnail_max_height %}

{% if thumbWidth <= 0 %}
{% set thumbWidth = 540 %}
{% endif %}

{% if thumbHeight <= 0 %}
{% set thumbHeight = 540 %}
{% endif %}
<section id="{{ page.folder|replace({'_': ''}) }}" class="main style3 primary">
<div class="content container">
<header>
Expand All @@ -14,7 +24,7 @@
{% endif %}
<div class="6u 12u(mobile)">
<a href="{{ page.media[image.full].url }}" class="image fit {% if loop.index % 2 == 1 %}from-left{% else %}from-right{% endif %}">
<img src="{{ page.media[image.thumbnail].url }}" title="{{ image.title|escape }}" />
<img src="{{ page.media[image.full].cropResize(thumbWidth, thumbHeight).url }}" title="{{ image.title|escape }}" />
</a>
</div>
{% if loop.index % 2 == 0 or loop.index == header.images|length %}
Expand Down

0 comments on commit fa9b6d7

Please sign in to comment.