Skip to content

Commit 6af7c7a

Browse files
committed
Add option to specify max size of container
1 parent e2543c4 commit 6af7c7a

File tree

7 files changed

+28
-6
lines changed

7 files changed

+28
-6
lines changed

CHANGELOG_de-DE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.13
2+
3+
* FEATURE Option hinzugefügt, um die maximale Containergröße zu definieren
4+
15
# 1.0.12
26

37
* BUGFIX Behebe Problem beim Ersetzen von Medien

CHANGELOG_en-GB.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.13
2+
3+
* FEATURE Added Option to set max width of container
4+
15
# 1.0.12
26

37
* BUGFIX Fix error when replacing media

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"thumbnail"
1212
],
1313
"description": "This plugins allows you to use variable thumbnails, without having them on storage.",
14-
"version": "1.0.12",
14+
"version": "1.0.13",
1515
"type": "shopware-platform-plugin",
1616
"license": "mit",
1717
"authors": [

src/Resources/app/storefront/dist/storefront/js/frosh-platform-thumbnail-processor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Resources/config/config.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<label>Fix Listing ThumbnailSizes</label>
3939
<defaultValue>1</defaultValue>
4040
<helpText>
41-
There is some problem with thumbnail-sizes in storefront.
41+
There are problems with thumbnail-sizes in storefront.
4242
This can help you delivering better matching sizes to the visitor.
4343
</helpText>
4444
</input-field>
@@ -48,11 +48,20 @@
4848
<label>Fix ThumbnailSizes in DetailGallery</label>
4949
<defaultValue>1</defaultValue>
5050
<helpText>
51-
There is some problem with thumbnail-sizes in the gallery of the product page.
51+
There are problems with thumbnail-sizes in the gallery of the product page.
5252
This can help you delivering better matching sizes to the visitor.
5353
</helpText>
5454
</input-field>
5555

56+
<input-field type="int">
57+
<name>DefaultContainerMaxSize</name>
58+
<label>Specific max width of container</label>
59+
<defaultValue>1360</defaultValue>
60+
<helpText>
61+
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.
62+
</helpText>
63+
</input-field>
64+
5665
<component name="frosh-thumbnail-processor-info-texts">
5766
<name>froshthumbnailprocessorinfotexts</name>
5867
</component>

src/Resources/public/administration/js/frosh-platform-thumbnail-processor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Resources/views/storefront/utilities/thumbnail.html.twig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
{% set container = 100 %}
2525
{% set sizes = sizes|merge({ 'xl': (container / columns)|round(0, 'ceil') ~'vw'}) %}
2626
{% else %}
27-
{% set container = 1360 %}
27+
{% set defaultContainerMaxSize = shopware.config.FroshPlatformThumbnailProcessor.config.DefaultContainerMaxSize %}
28+
{% if defaultContainerMaxSize is defined %}
29+
{% set container = defaultContainerMaxSize %}
30+
{% else %}
31+
{% set container = 1360 %}
32+
{% endif %}
2833
{% set sizes = sizes|merge({ 'xl': (container / columns)|round(0, 'ceil') ~'px'}) %}
2934
{% endif %}
3035
{% endif %}

0 commit comments

Comments
 (0)