vendor/conecto/pimcore-provider/src/ProviderBundle/Resources/views/areas/textmedia/view.html.twig line 1

Open in your IDE?
  1. {% from '@Provider/macros/media.html.twig' import media as conecto_media %}
  2. {% from '@Provider/macros/media_edit.html.twig' import media_edit as conecto_media_edit %}
  3. {# Default block settings #}
  4. {% set class = pimcore_input('class').getData() %}
  5. {% set marginTop = pimcore_select('margin_top').getData() %}
  6. {% set marginBottom = pimcore_select('margin_bottom').getData() %}
  7. {% set containerWidth = pimcore_select('container_width').getData() %}
  8. {% set areaClass = class ~ ' ' ~ marginTop ~ ' ' ~ marginBottom ~ ' ' ~ containerWidth %}
  9. {% set anchorId = pimcore_input('anchor').getData() %}
  10. {# Block specific settings #}
  11. {% set position = pimcore_select('position').getData() %}
  12. {% set mediaWidth = pimcore_select('media_width').getData() ? pimcore_select('media_width').getData() : 50 %}
  13. {% set textWidth = pimcore_select('media_width').getData() ? (100 - pimcore_select('media_width').getData())  : 50 %}
  14. {% set colRatio = position == 'right' ? textWidth ~ '-' ~ mediaWidth : mediaWidth ~ '-' ~ textWidth %}
  15. {% set imageRatio = pimcore_select('ratio').getData() ? pimcore_select('ratio').getData() : 3/2 %}
  16. {% set showLightbox = not pimcore_checkbox('no_lightbox').isChecked() %}
  17. {% set showCopyright = pimcore_checkbox('copyright').isChecked() %}
  18. {% set showCaption = pimcore_checkbox('caption').isChecked() %}
  19. {# Special video settings #}
  20. {% set videoAddAttributes = {} %}
  21. {% set videoRemoveAttributes = pimcore_checkbox('controls').isChecked() ? [] : ['controls'] %}
  22. {% if pimcore_checkbox('autoplay').isChecked() %}{% set videoAddAttributes = videoAddAttributes|merge({autoplay: '', playsinline: ''}) %}{% endif %}
  23. {% if pimcore_checkbox('loop').isChecked() %}{% set videoAddAttributes = videoAddAttributes|merge({loop: ''}) %}{% endif %}
  24. {% if pimcore_checkbox('mute').isChecked() %}{% set videoAddAttributes = videoAddAttributes|merge({muted: ''}) %}{% endif %}
  25. <div class="area area--textmedia {{ areaClass }}{{ pimcore_checkbox('highlight').isChecked() ? ' highlight' : '' }}"{% if anchorId %} id="{{ anchorId }}"{% endif %}>
  26.     <div class="cols cols--2 thumbnail--{{ position }}{% if colRatio is not empty %} ratio--{{ colRatio }}{% endif %}">
  27.         <figure class="area--thumbnail col">
  28.             {% if editmode %}
  29.                 {{ conecto_media_edit(
  30.                     'textmedia_',
  31.                     (1920 * mediaWidth / 100),
  32.                     (1920 * mediaWidth / 100) / imageRatio
  33.                 ) }}
  34.             {% else %}
  35.                 {% if not pimcore_image('textmedia_image').isEmpty() %}
  36.                     {{ conecto_media(
  37.                         pimcore_image('textmedia_image').getImage(),
  38.                         editmode,
  39.                         showLightbox,
  40.                         showCopyright,
  41.                         showCaption,
  42.                         {
  43.                             thumbName: 'textMedia',
  44.                             ratio: imageRatio,
  45.                             cols: 100 / mediaWidth,
  46.                             widgetAltText: pimcore_image('textmedia_image').getAlt()
  47.                         }
  48.                     ) }}
  49.                 {% endif %}
  50.                 {% if not pimcore_video('textmedia_video').isEmpty() %}
  51.                     {{ pimcore_video('textmedia_video', {
  52.                         "width": "100%",
  53.                         "height": "100%",
  54.                         "attributes": videoAddAttributes,
  55.                         "removeAttributes": videoRemoveAttributes
  56.                     }) }}
  57.                 {% endif %}
  58.             {% endif %}
  59.         </figure>
  60.         <div class="area--text area--textmedia--text col">
  61.             <div class="area--text--inner">
  62.                 {{ pimcore_wysiwyg('text') }}
  63.                 {% if editmode %}
  64.                     {{ pimcore_link('link', { 'reload': true }) }}
  65.                 {% endif %}
  66.                 {% if not pimcore_link('link').isEmpty() %}
  67.                     <p>
  68.                         <a href="{{ pimcore_link('link').getHref() }}" class="btn btn-{% if pimcore_link('link').getClass() %}{{ pimcore_link('link').getClass() }}{% else %}primary{% endif %}" {% if pimcore_link('link').getTarget() %}target="{{ pimcore_link('link').getTarget() }}"{% endif %}>
  69.                             {{ pimcore_link('link').getText() }}
  70.                         </a>
  71.                     </p>
  72.                 {% endif %}
  73.             </div>
  74.         </div>
  75.     </div>
  76. </div>