{% if posts or title or text %}
  {% set archiveLink = fn.get_post_type_archive_link('testimonials') %}
  <section class="m_testimonial m_panel" m-pack="premium">
    {% include 'm_components/widgets/headline.twig' with {
      title : title,
      text: text,
      link: archiveLink
    }
    only %}
    {% if posts %}
      <div class="flex">
        {% for post in posts %}

          {% set tax = fn.wp_get_post_terms(post.ID, 'category', {'fields': 'names'}) %}

          {% set post_title = post.post_title %}
          {% set post_text = post.post_content%}
          {% set post_date = post.post_date | date('d. m. y') %}
          {% set dateTime = post.post_date|date('Y-m-d') %}

          {% set post_link = fn.get_the_permalink(post.ID) %}

          {#{% set postThumbM = fn.get_the_post_thumbnail_url(post.ID, 'medium') %}
          {% set postThumbS = fn.get_the_post_thumbnail_url(post.ID, 'thumbnail') %}#}
          {% set image = fn.get_post_thumbnail_id(item.ID) %}

          <a href="{{post_link}}" class="m_testimonial__block">

            <div class="m_testimonial__image ">
              {#{% if post.video_news %}
                <span class="m_video__player"></span>{% endif %}
              <picture class="objectfit--cover">
                <source media="(min-width: 786px)" lazy-src="{{postThumbM}}">
                <source media="(min-width: 320px)" lazy-src="{{postThumbS}}">
                <img lazy-src="{{postThumbM}}" alt="{{postTitle}}">
              </picture>#}
              {% include 'm_components/widgets/picture.twig' with {image: image, title: title} only %}
            </div>

            <div class="m_testimonial__content">

              {#<small>
                <time datetime="{{dateTime}}">{{ post_date }}</time>
                {% if tax %}
                  <span class="separator">|</span>
                  {{tax|join(', ')}}
                {% endif %}
              </small>
              <h3>{{post_title}}</h3>#}
              {% if post_text %}
                <p>{{post_text|striptags}}</p>
              {% endif %}

              {# ***** Données en dur ***** #}
              <p class="name">John Doe</p>
              {# ***** Fin données en dur ***** #}
            </div>
          </a>

        {% endfor %}
      </div>

    {% endif %}
      {#{% if archive %}
      {% include 'm_components/widgets/link.twig' with {
        textBtn : "View more",
        link: archiveLink
      }
    only %}
    {% endif %}#}
  </section>
{% endif %}
