{% set spacingSelect %}
{{ pimcore_checkbox("checkSpacing", {
"reload": true
}) }}
{% endset %}
{% set noSpacingTop = '' %}
{% set brickAnchorId = '' %}
{% if pimcore_checkbox('checkSpacing').isChecked() %}
{% set noSpacingTop = 'no-offset-top' %}
{% endif %}
{% set UID = uniqid() %}
{% if pimcore_input("brickAnchorIdInput") is not empty %}
{% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
{% endif %}
{% set productLink = pimcore_href("selectProduct").getElement() %}
{% set imageAttributes = {
"attributes" : {
"data-speed": "-1"
}
} %}
{% set isProductFood = false %}
{% set ingredientsText = null %}
{% if productLink == true %}
{% set fitsPerfectlyResult = productLink.getGoesWellWith() %}
{% if productLink.getClassName() == 'ProductFood' %}
{% set isProductFood = true %}
{% set ingredientsText = productLink.getIngredientsText() %}
{% endif %}
{% endif %}
{% if editmode %}
<div class="flex-col offset-bottom-single">
<div class="col xs-12 m-6 l-3">
<span class="hint">{{ 'ID für Anchorlinks vergeben' |trans }}</span>
{{ pimcore_input("brickAnchorIdInput") }}
</div>
<div class="col xs-12 m-6 l-3">
<div class="select-items">
<div class="hint">
{{ 'Kein Abstand nach oben?' |trans }}
</div>
{{ spacingSelect }}
</div>
</div>
</div>
<div class="flex-col offset-bottom-single">
<div class="col xs-12 m-6 l-6">
<span class="hint">
{{ 'Bitte wählen Sie ein Produkt'|trans }}</span>
{{ pimcore_href("selectProduct", {
"types": ["object"],
"subtypes": {
"types": ["object"],
},
"classes": ["ProductFood"],
"reload": true
}) }}
</div>
<div class="col xs-12 m-6 l-6">
<span class="hint">
{{ 'Hintergrund-Bild'|trans }}</span>
{{ pimcore_image("fitsPerfectBackgroundImage", {
"width": 500,
"height": 100,
"title": "Drag your image here",
"thumbnail": "fitsPerfectBackgroundImage" ~ bundleName,
"reload": true
}) }}
</div>
</div>
{% endif %}
<div id="{{ brickAnchorId }}" class="section {{ noSpacingTop }}">
<div id="{{ 'uid' ~ UID |raw }}" class="has-background-image js teaser-interstitial fits-perfect">
<div class="background-image">
<div class="image">
{% if pimcore_image("fitsPerfectBackgroundImage").getThumbnail("fitsPerfectBackgroundImage" ~ bundleName) is not empty %}
{{ pimcore_image("fitsPerfectBackgroundImage").getThumbnail("fitsPerfectBackgroundImage" ~ bundleName).getHTML(imageAttributes) |raw }}
{#IE Fix for thumbnails rendering start#}
<script type='text/javascript'>
var waitForJQuery = setInterval(function () {
if (typeof $ != 'undefined') {
$(function() {
if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){
$(".fits-perfect .background-image .image").css({
position: "absolute",
width: "100%",
height: "100%",
background: "url( {{ pimcore_image("fitsPerfectBackgroundImage").getSrc() }} ) center right 100%/cover no-repeat"
});
$(".fits-perfect .background-image .image img").hide();
}
});
clearInterval(waitForJQuery);
}
}, 50);
</script>
{#IE Fix for thumbnails rendering end#}
{% endif %}
</div>
</div>
<div class="content-container offset">
<div class="main-content flex-col">
<div class="col xs-12 m-12 l-3 headline-wrapper">
<div class="text-only">
<div class="headline">
<h3> {{ pimcore_input("fitsHeadline", {'placeholder': 'Headline'}) }}</h3>
</div>
</div>
</div>
<div class="col xs-12 m-12 l-9 flex-col icon-wrapper box-center">
{% if productLink == true %}
{% for keyResult in fitsPerfectlyResult %}
<div class="text-icon-container">
<div class="text-icon">
<div class="flex-column box-align-center">
<span class="icon {{ keyResult }}"></span>
<p>{{ keyResult |trans }}</p>
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
{% if isProductFood and ingredientsText is not empty %}
<div class="section">
<div class="main-content flex-col">
<div class="col xs-12">
<div class="bb-flex align-item-start">
<div class="bb-flex-2"></div>
<div class="product-information-wrapper bb-flex-1">
<div class="sales-description-wrapper">
{{ productLink.getSalesDescription() }}
</div>
<div id="tabber-xyz" class="tabber" data-tab-type="default">
<ul class="tabs resp-tabs-list tab-id">
<li class="resp-tab-item tab-id resp-tab-active" aria-controls="tab-id_tab_item-0" role="tab">{{ 'Nährwerte' | trans }}</li>
<li class="resp-tab-item tab-id" aria-controls="tab-id_tab_item-1" role="tab">{{ 'Zutaten' | trans }}</li>
</ul>
<div class="resp-tabs-container tab-id">
<h3 class="resp-accordion tab-id resp-tab-active" role="tab" aria-controls="tab-id_tab_item-0">{{ 'Nährwerte' | trans }}</h3><div class="tab-content resp-tab-content tab-id resp-tab-content-active" aria-labelledby="tab-id_tab_item-0" style="display:block">
<div class="food-value-container">
{% include 'Partials/NutritionFactsDefault.html.twig' with {
'product': productLink
} %}
</div>
</div>
<h3 class="resp-accordion tab-id" role="tab" aria-controls="tab-id_tab_item-1">{{ 'Zutaten' | trans }}</h3><div class="tab-content resp-tab-content tab-id" aria-labelledby="tab-id_tab_item-1">
<div class="product-ingredients-container">
<div class="ingredients-item">
{{ ingredientsText | raw }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
</div>