{% if sections or text or title %}
<section class="m_textImg" m-pack="basic">
  {% include 'm_components/widgets/headline.twig' with {title: title, text: text} only %}

  {% if sections %}
  <div class="section-grid">
    {% for section in sections %}
      {% set direction = loop.index%2 == 1 ? "right" : "left"%}
      <article class="m_textImg__block m_textImg--{{direction}}">
          {% if section.image.id %}
            <div class="m_textImg__image ">
              {% include 'm_components/widgets/picture.twig' with {image: section.image, title: title} only %}
            </div>
         {% endif %}

          {% if section.title or section.text or section.link %}
            <div class="m_textImg__content m_content">
              {% if section.title %}<h3>{{section.title|raw}}</h3>{% endif %}
              {% if section.text %}{{ fn.apply_filters('the_content', fn.html_entity_decode(section.text) )|raw }}{% endif %}
              {% set label_link = section.label_link ? section.label_link : "Lire plus" %}
              {% if section.link %}<a class="btn btn__primary" href="{{section.link|raw}}">{{label_link|raw}}</a>{% endif %}
          </div>
          {% endif %}
      </article>
    {% endfor %}
  </div>

  {% endif %}
  {% include 'm_components/widgets/link.twig' with {textBtn: button_text, link:button_link} only %}
</section>
{% endif %}
