From e08ec4c94552ac53d0275fabb879e017c8908133 Mon Sep 17 00:00:00 2001 From: Jeremy Seipelt Date: Fri, 15 Oct 2021 13:39:50 +0200 Subject: [PATCH] changed badge offset --- Resources/config/config.xml | 60 +++++++------------ Resources/views/storefront/base.html.twig | 26 +------- .../storefront/layout/footer/footer.html.twig | 12 ++-- .../components/badge.html.twig | 22 ++++++- 4 files changed, 51 insertions(+), 69 deletions(-) diff --git a/Resources/config/config.xml b/Resources/config/config.xml index f7931dc..1788d9e 100644 --- a/Resources/config/config.xml +++ b/Resources/config/config.xml @@ -55,6 +55,26 @@ Add Manually Manuell Einfügen + + + + @@ -82,44 +102,8 @@ - - float - - - Select if the badge should be floating instead of being part of the footer - Wählen Sie ob das Badge am Bildschirm klebt, anstelle Teil des Footers zu sein - none - - - - - - - - - - offsetX + floatingOffsetX Offset on the X axis from the nearest edge. Only affects floating badges! @@ -128,7 +112,7 @@ - offsetY + floatingOffsetY Offset on the Y axis from the nearest edge. Only affects floating badges! diff --git a/Resources/views/storefront/base.html.twig b/Resources/views/storefront/base.html.twig index e750433..7de2c68 100644 --- a/Resources/views/storefront/base.html.twig +++ b/Resources/views/storefront/base.html.twig @@ -1,32 +1,12 @@ {% sw_extends '@Storefront/storefront/base.html.twig' %} -{% set float = config('ZmbGoogleCustomerReviews.config.float') %} -{% set offsetY = config('ZmbGoogleCustomerReviews.config.offsetY') %} -{% set offsetX = config('ZmbGoogleCustomerReviews.config.offsetX') %} - -{% macro offset(context) %} - {% if context.float == "top_left" %} - {% set axisY = "top" %} - {% set axisX = "left" %} - {% elseif context.float == "top_right" %} - {% set axisY = "top" %} - {% set axisX = "right" %} - {% elseif context.float == "bottom_left" %} - {% set axisY = "bottom" %} - {% set axisX = "left" %} - {% elseif context.float == "bottom_right" %} - {% set axisY = "bottom" %} - {% set axisX = "right" %} - {% endif %} - {{axisY}}:{{context.offsetY}}px;{{axisX}}:{{context.offsetX}}px; -{% endmacro %} - +{% set position = config('ZmbGoogleCustomerReviews.config.position') %} {% block base_body_inner %} {{parent()}} - {% if float != 'none' %} - {% sw_include '@Storefront/pro-customer-reviews/components/badge.html.twig' with { class: "floating", offset: _self.offset(_context) } %} + {% if position == 'top_left' or position == 'top_right' or position == 'bottom_right' or position == 'bottom_left' %} + {% sw_include '@Storefront/pro-customer-reviews/components/badge.html.twig' with { class: "floating" } %} {% endif %} {% endblock %} diff --git a/Resources/views/storefront/layout/footer/footer.html.twig b/Resources/views/storefront/layout/footer/footer.html.twig index 61d3d8f..97aec1e 100644 --- a/Resources/views/storefront/layout/footer/footer.html.twig +++ b/Resources/views/storefront/layout/footer/footer.html.twig @@ -7,7 +7,7 @@ {% block layout_footer_navigation_columns %} {{parent()}} - {% if positon == "new-column" and float == "none" %} + {% if positon == "new-column" %}