{% set containerWidth = pimcore_select('container_width').data %}
{% set backgroundImage = pimcore_image('background_image') %}
{% set fullWidthBackground = pimcore_checkbox('full_width_background').isChecked() %}
{% set backgroundImagePosition = pimcore_select('background_image_position') %}
{% set backgroundImageSize = pimcore_select('background_image_size') %}
{% set backgroundImageRepeat = pimcore_select('background_repeat') %}
{% if backgroundImage is not null and not fullWidthBackground %}
{% set containerClass = containerClass ~ " container-bg-img bg-img-" ~ backgroundImage.getId() %}
{% endif %}
{# Adds CSS for responsive background image css. The CSS class is .bg-img-[imageId] #}
{% include 'digitalwandler//Components/bgImgCss.html.twig' with {'bgImg': backgroundImage, 'bgImgPos': backgroundImagePosition, 'bgImgSize': backgroundImageSize, 'bgImgRepeat': backgroundImageRepeat } %}
{% if fullWidthBackground and backgroundImage is not null %}
{# Renders a container around the container to allow for a full-width-background but a normal container #}
<div class="container-fluid container-with-background-image bg-img-{{backgroundImage.getId() }}">
{% endif %}
<div class="{{ containerClass }} mx-auto {{ (containerWidth|length) ? containerWidth : 'px-4' }}">
<div class="container-inner">
{% include '@Toolbox/helper/areablock.html.twig' with {'name': 'container-block', 'type' : 'container'} %}
</div>
</div>
{% if fullWidthBackground and backgroundImage %}
</div>
{% endif %}