stack/src/components/sections/text-and-media-section/text-and-media-section.twig line 1

Open in your IDE?
  1. {% set com_props = props %}
  2. {%- set section_extra = [
  3.   props.order in ["reverse", "default"] ? "--" ~ props.order : "--default",
  4.   props.variant in ["product"] ? "--" ~ props.variant : null,
  5.   props.extra_class
  6. ]|join(' ')|trim -%}
  7. {% set section_props = {
  8.   name: "s-text-media",
  9.   id: props.id,
  10.   is_container: props.is_container,
  11.   spacing: props.spacing,
  12.   extra_class: section_extra,
  13.   bg_color: props.bg_color,
  14. } %}
  15. {% set header_position = props.header_position|default("in") %}
  16. {% set header_in_props = {
  17.   heading: {
  18.     title: props.header.heading.title,
  19.     level: props.header.heading.level|default(2),
  20.     style: "h2",
  21.   },
  22.   spacing: "sm",
  23.   variant: "left",
  24.   extra_class: "s-text-media__header-in",
  25. } %}
  26. {% set buttons = {} %}
  27. {% if props.buttons.primary %}
  28.   {% set buttons = {
  29.     primary: {
  30.       title: props.buttons.primary.title,
  31.       url: props.buttons.primary.url,
  32.       icon: {
  33.         src: "@Images/svg/chevron-right.svg",
  34.         size: "lg"
  35.       }
  36.     }
  37.   } %}
  38. {% else %}
  39.   {% set buttons = {
  40.     outline: {
  41.       title: props.buttons.outline.title,
  42.       url: props.buttons.outline.url
  43.     }
  44.   } %}
  45. {% endif %}
  46. {% set buttons_props = {
  47.   buttons: buttons,
  48.   align: "left",
  49.   spacing: "lg",
  50. } %}
  51. {% embed "@Components/base-section/base-section.twig" with {props: section_props} %}
  52.   {% block content %}
  53.     {% if com_props.header and header_position == "out" %}
  54.       {% include "@Components/base-header/base-header.twig" with {props: com_props.header} %}
  55.     {% endif %}
  56.     <div class="s-text-media__grid">
  57.       {% if com_props.media %}
  58.         <div class="s-text-media__col --media-col w-100">
  59.           {% include "@Components/items/media-item/media-item.twig" with {props: com_props.media|merge({
  60.             variant: com_props.variant
  61.           })} %}
  62.         </div>
  63.       {% else %}
  64.         <div class="s-text-media__col --media-col w-100">
  65.           {% include "@Components/items/media-item/media-item.twig" with {props: {
  66.             variant: com_props.variant,
  67.             tag: com_props.tag
  68.           }} %}
  69.         </div>
  70.       {% endif %}
  71.       <div class="s-text-media__col --content-col d-flex flex-column justify-content-center w-100">
  72.         {% if com_props.header and header_position == "in" %}
  73.           {% include "@Components/base-header/base-header.twig" with {props: header_in_props} %}
  74.         {% endif %}
  75.         {% if com_props.description %}
  76.           <div class="s-text-media__description d-flex flex-column gap-6 mb-3">
  77.             <div class="s-text-media__meta d-flex flex-column gap-1">
  78.               {% if com_props.description.family %}
  79.                 <div class="s-text-media__family d-flex flex-wrap gap-1 u-color-primary u-fz-sm u-fw-600">
  80.                   <div class="u-color-primary-500 u-fw-400 s-text-media__meta-label">{{ "Rodina:"|trans }}</div>
  81.                   {{ com_props.description.family }}
  82.                 </div>
  83.               {% endif %}
  84.               {% if com_props.description.category %}
  85.                 <div class="s-text-media__category d-flex flex-wrap gap-1 u-color-primary u-fz-sm u-fw-600">
  86.                   <div class="u-color-primary-500 u-fw-400 s-text-media__meta-label">{{ "Kategorie:"|trans }}</div>
  87.                   {{ com_props.description.category }}
  88.                 </div>
  89.               {% endif %}
  90.               {% if com_props.description.code %}
  91.                 <div class="s-text-media__code d-flex flex-wrap gap-1 u-color-primary u-fz-sm u-fw-600">
  92.                   <div class="u-color-primary-500 u-fw-400 s-text-media__meta-label">{{ "Kód:"|trans }}</div>
  93.                   {{ com_props.description.code }}
  94.                 </div>
  95.               {% endif %}
  96.             </div>
  97.             {% if com_props.description.specs %}
  98.               <div class="s-text-media__specs d-flex flex-wrap gap-2 u-posr">
  99.                 {% for item in com_props.description.specs %}
  100.                   {% include "@Components/items/tooltip-item/tooltip-item.twig" with {props: item.tooltip|merge({
  101.                     extra_class: "s-text-media__tooltip"
  102.                   })} %}
  103.                 {% endfor %}
  104.               </div>
  105.             {% endif %}
  106.           </div>
  107.         {% endif %}
  108.         {% if com_props.content %}
  109.           <div class="s-text-media__body entry-content u-color-primary-500">
  110.             {{ com_props.content|raw }}
  111.           </div>
  112.         {% endif %}
  113.         {% if com_props.buttons %}
  114.           {% include "@Components/groups/buttons-group/buttons-group.twig" with {props: buttons_props} %}
  115.         {% endif %}
  116.       </div>
  117.     </div>
  118.   {% endblock %}
  119. {% endembed %}