Skip to content

Commit

Permalink
Add option to specify max size of container
Browse files Browse the repository at this point in the history
  • Loading branch information
tinect committed Oct 27, 2020
1 parent e2543c4 commit 6af7c7a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.13

* FEATURE Option hinzugefügt, um die maximale Containergröße zu definieren

# 1.0.12

* BUGFIX Behebe Problem beim Ersetzen von Medien
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.13

* FEATURE Added Option to set max width of container

# 1.0.12

* BUGFIX Fix error when replacing media
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"thumbnail"
],
"description": "This plugins allows you to use variable thumbnails, without having them on storage.",
"version": "1.0.12",
"version": "1.0.13",
"type": "shopware-platform-plugin",
"license": "mit",
"authors": [
Expand Down

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions src/Resources/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<label>Fix Listing ThumbnailSizes</label>
<defaultValue>1</defaultValue>
<helpText>
There is some problem with thumbnail-sizes in storefront.
There are problems with thumbnail-sizes in storefront.
This can help you delivering better matching sizes to the visitor.
</helpText>
</input-field>
Expand All @@ -48,11 +48,20 @@
<label>Fix ThumbnailSizes in DetailGallery</label>
<defaultValue>1</defaultValue>
<helpText>
There is some problem with thumbnail-sizes in the gallery of the product page.
There are problems with thumbnail-sizes in the gallery of the product page.
This can help you delivering better matching sizes to the visitor.
</helpText>
</input-field>

<input-field type="int">
<name>DefaultContainerMaxSize</name>
<label>Specific max width of container</label>
<defaultValue>1360</defaultValue>
<helpText>
There may be reasons you modified the container max size. So you can adjust this here for thumbnails. If you don't know, keep it at 1360.
</helpText>
</input-field>

<component name="frosh-thumbnail-processor-info-texts">
<name>froshthumbnailprocessorinfotexts</name>
</component>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/Resources/views/storefront/utilities/thumbnail.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
{% set container = 100 %}
{% set sizes = sizes|merge({ 'xl': (container / columns)|round(0, 'ceil') ~'vw'}) %}
{% else %}
{% set container = 1360 %}
{% set defaultContainerMaxSize = shopware.config.FroshPlatformThumbnailProcessor.config.DefaultContainerMaxSize %}
{% if defaultContainerMaxSize is defined %}
{% set container = defaultContainerMaxSize %}
{% else %}
{% set container = 1360 %}
{% endif %}
{% set sizes = sizes|merge({ 'xl': (container / columns)|round(0, 'ceil') ~'px'}) %}
{% endif %}
{% endif %}
Expand Down

0 comments on commit 6af7c7a

Please sign in to comment.