src/CoreBundle/Resources/views/FieldCollections/TextBackground.html.twig line 1

Open in your IDE?
  1. {% set UID = uniqid() %}
  2. {% set imageAttributes = {
  3. "attributes" : {
  4. "data-speed": "-1"
  5. }
  6. } %}
  7. <div class="section" id="content-section">
  8.     <div id="{{ 'uid' ~ UID |raw }}" class="text-background {% if item.getBackgroundImage %}has-background-image js{% else %}has-background{% endif %}">
  9.         {% if item.getBackgroundImage %}
  10.         <div class="background-image">
  11.             <div class="image">
  12.                 {{ item.getBackgroundImage().getThumbnail("textBackgroundImage" ~ bundleName).getHtml(imageAttributes) |raw }}
  13.                     {#IE Fix for thumbnails rendering start#}
  14.                     <style>
  15.                         @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  16.                         {{ 'div#uid' ~ UID |raw }} .background-image > .image {
  17.                             position: absolute;
  18.                             width: 100%;
  19.                             height: 100%;
  20.                             background: url( {{ pimcore_image("getBackgroundImage").getSrc() }} ) center right 100%/cover no-repeat;
  21.                         }
  22.                         {{ 'div#uid' ~ UID |raw }} .background-image > .image img {
  23.                                                        display: none;
  24.                                                    }
  25.                         }
  26.                     </style>
  27.                     {#IE Fix for thumbnails rendering end#}
  28.             </div>
  29.         </div>
  30.         {% endif %}
  31.         {% if item.getBackgroundImage %}
  32.         <div class="content-container">
  33.         {% endif %}
  34.             <div class="main-content flex-col">
  35.                 <div class="col xs-12">
  36.                     <div class="text-only">
  37.                         {{ item.getText() |raw }}
  38.                         {% if item.getButton %}
  39.                             <div class="button">
  40.                                 <a href="{{ item.getButton.getHref() }}" class="button btn-default">
  41.                                     {{ item.getButton.getText() |raw }}
  42.                                 </a>
  43.                             </div>
  44.                         {% endif %}
  45.                     </div>
  46.                 </div>
  47.             </div>
  48.         {% if item.getBackgroundImage %}
  49.         </div>
  50.        {% endif %}
  51.     </div>
  52. </div>