text-media

Information

Folder
src/components/patterns/text-media

Files

Schema
Mocks
Template
// src/components/patterns/text-media/text-media.html.twig

{#
  Helper:
    - checks the image format: landscape or portrait;
    - portrait images should take 4 columns;
    - landscape images should take 5 columns;
#}
{% if media.image %}
  {% set image_type = media.is_portrait ? 'portraitImage' : 'landscapeImage' %}
{% endif %}

<div class="TextMedia u-container u-grid
            {%- if position and rte %} TextMedia--{{ position }}{% endif -%}
            {%- if image_type %} TextMedia--{{ image_type }}{% endif -%}
            {%- if not rte %} TextMedia--mediaOnly{% endif -%}
            {%- if media.image %} TextMedia--mediaImage{% endif -%}
            {%- if media.youtube_id %} TextMedia--mediaVideo{% endif -%}
            {%- if full_width %} TextMedia--fullWidth{% endif -%}
">
  <div class="TextMedia-content">
    {% if headline %}
      <h2 class="TextMedia-headline">{{ headline|german_quotes }}</h2>
    {% endif %}
    {% if media %}
      {% set media = media|merge({class: "TextMedia-media"}) %}
      {% include "@elements/media-template/media-template.html.twig" with media only %}
    {% endif %}
    {% if rte %}
      {% include "@elements/rte/rte.html.twig" with rte only %}
    {% endif %}
  </div>
</div>

Variants

Only rte
Open

Only rte mock data

Raw
Resolved
Only rte short
Open

Only rte short mock data

Raw
Resolved
Only landscape image
Open

Only landscape image mock data

Raw
Resolved
Only portrait image
Open

Only portrait image mock data

Raw
Resolved
Only youtube video
Open

Only youtube video mock data

Raw
Resolved
Only youtube video with the cover image
Open

Only youtube video with the cover image mock data

Raw
Resolved
Rte with right video
Open

Rte with right video mock data

Raw
Resolved
Rte short with right video
Open

Rte short with right video mock data

Raw
Resolved
Rte with left video
Open

Rte with left video mock data

Raw
Resolved
Rte with left landscape image
Open

Rte with left landscape image mock data

Raw
Resolved
Rte with right landscape image
Open

Rte with right landscape image mock data

Raw
Resolved
Rte with left portrait image
Open

Rte with left portrait image mock data

Raw
Resolved
Rte with right portrait image
Open

Rte with right portrait image mock data

Raw
Resolved
Rte with left image and list
Open

Rte with left image and list mock data

Raw
Resolved
Rte with right image and lists
Open

Rte with right image and lists mock data

Raw
Resolved
Full width
Open

Full width mock data

Raw
Resolved