-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #315 from damonsson/2.0
performance optimizations, split templates, lazyload some images
- Loading branch information
Showing
7 changed files
with
53 additions
and
4 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
Binary file not shown.
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,8 @@ | ||
<div class="mb-6"> | ||
<div class="overflow-hidden"> | ||
<div class="d-flex justify-content-center align-items-center position-relative"> | ||
<img src="{{ asset('build/shop/images/homepage-banner.webp', 'shop') }}" width="1920" height="793" class="img-fluid" alt="Home"> | ||
<img src="{{ asset('build/shop/images/homepage-banner-logo.webp', 'shop') }}" class="position-absolute" style="max-width: 40vw" alt="New collection"> | ||
</div> | ||
</div> | ||
</div> |
31 changes: 31 additions & 0 deletions
31
templates/bundles/SyliusShopBundle/homepage/card_deals.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,31 @@ | ||
<div {{ sylius_test_html_attribute('product', '%s'|format(product.code)) }} > | ||
<a class="link-reset" href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale}) }}" {{ sylius_test_html_attribute('product-content') }}> | ||
<div class="mb-4"> | ||
<div class="overflow-auto bg-light rounded-3" style="aspect-ratio: 3/4; "> | ||
{% if key == 1 %} | ||
{{ component('sylius_shop:main_image', { | ||
product: product, | ||
class: "w-100 h-100 object-fit-cover", | ||
filter: 'sylius_shop_product_small_thumbnail' | ||
}) }} | ||
{% else %} | ||
{{ component('sylius_shop:main_image', { | ||
product: product, | ||
class: "w-100 h-100 object-fit-cover", | ||
loading: 'lazy', | ||
filter: 'sylius_shop_product_small_thumbnail' | ||
}) }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="h6 text-break" {{ sylius_test_html_attribute('product-name', product.name) }}> | ||
{{ product.name }} | ||
</div> | ||
</a> | ||
<div> | ||
{% if not product.enabledVariants.empty() %} | ||
{{ component('sylius_shop:catalog_promotions', { variant: variant, appliedPromotions: applied_promotions, withDescription: false }) }} | ||
{{ component('sylius_shop:product:card:price', { variant: variant, template: '@SyliusShop/product/common/price.html.twig' }) }} | ||
{% endif %} | ||
</div> | ||
</div> |
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
templates/bundles/SyliusShopBundle/homepage/list_deals.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,11 @@ | ||
<div class="container mb-6"> | ||
<h2 class="mb-5">{{ hookable_metadata.configuration.title|default('sylius.ui.latest_products')|trans }}</h2> | ||
|
||
<div {{ sylius_test_html_attribute(hookable_metadata.configuration.test_attribute|default('latest-products')) }}> | ||
<div class="products-grid"> | ||
{% for key,product in latest_products %} | ||
<div>{{ component('sylius_shop:product:card', { key: loop.index, product: product, template: '@SyliusShop/homepage/card_deals.html.twig' }) }}</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> |
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