{% set title = post.post_title %}
{% set content = post.post_content %}
{% set date = fn.get_the_date() %}

{% set thumbL = fn.get_the_post_thumbnail_url( post.ID, 'large') %}
{% set thumbM = fn.get_the_post_thumbnail_url(post.ID, 'medium') %}
{% set thumbS = fn.get_the_post_thumbnail_url(post.ID, 'thumbnail') %}
{% if not thumbL %}{% set thumbL = fn.get_template_directory_uri()~'/dist/images/og-format@3x.png' %}{% endif %}
{% if not thumbM %}{% set thumbM = fn.get_template_directory_uri()~'/dist/images/og-format@2x.png' %}{% endif %}
{% if not thumbS %}{% set thumbS = fn.get_template_directory_uri()~'/dist/images/og-format.png' %}{% endif %}

{# og #}
{% set og_title = title %}
{% set og_desc = post.post_excerpt %}
{% set og_thumb = fn.get_the_post_thumbnail_url(post.ID, 'thumbnail') %}
{% set og_url = fn.get_the_permalink(post.ID) %}
{% if not og_desc %}{% set og_desc =  post.post_excerpt ? post.post_excerpt : post.post_content|slice(0,180)  %}{% endif %}


{% extends 'm_layout/base.twig' %}

{% block main %}

{% if comp %}
    {{ render_comp(comp, 'main') }}
{% endif %}

<article class="m_faqs" m-pack="single">
  <div class="grid--lg">
    {% include 'm_pages/components/headline.twig' with {
      title : title,
      text: content,
    }
    only %}
    {% if posts %}
      <ul class="m_details section-grid">
        {% for post in posts %}
          <li class="m_details-item">
            <strong class="m_details-item__head">{{post.post_title}}</strong>
            <div class="m_details-item__body">
              {{fn.apply_filters('the_content', fn.html_entity_decode(post.post_content))|raw}}
            </div>
          </li>
        {% endfor %}
      </ul>

    {% else %}
        <p>{{__('Sorry, there is no ' ~  post.post_type ~ 'yet' , constant('M_TD')) }}</p>
    {% endif %}
  </div>
</article>

{% endblock %}
