{% extends "_layouts/main.html" %} {% import 'macros.twig' as macros %} {% block main %} {% set contacts_page = craft.entries().section('contacts').one() ?? null %} {% set products = craft.entries() .section('products') .orderBy('postDate asc') .all() %} {# ========================= SEC 1 — INTRO products_section_1: - section_title - image ========================= #} {% set sec1 = entry.products_section_1.one() ?? null %} {% if sec1 %} {% set sec1_img = sec1.image.one() ?? null %}

{{ sec1.section_title ? macros.limpar_paragrafos(sec1.section_title) : macros.limpar_paragrafos(entry.title) }}

{% endif %} {# ========================= SEC 2 — INTRO TEXTO products_section_2: - section_subtitle - section_title - text ========================= #} {% set sec2 = entry.products_section_2.one() ?? null %} {% if sec2 %}
{% if sec2.section_subtitle %}

{{ macros.limpar_paragrafos(sec2.section_subtitle) }}

{% endif %} {% if sec2.section_title %}

{{ macros.limpar_paragrafos(sec2.section_title) }}

{% endif %} {% if sec2.text %}

{{ macros.limpar_paragrafos(sec2.text) }}

{% endif %}
{% endif %} {# ========================= PRODUTOS INDIVIDUAIS products: - title - text_2 - features - image ========================= #} {% if products|length %} {% for product in products %} {% set product_img = product.image.one() ?? null %} {% set contact_href = contacts_page ? contacts_page.url : '#' %} {# ID para anchors vindos da homepage #} {% set product_id = (product.title ?? '')|ascii|lower %} {% set product_id = product_id|replace({'º':'','ª':'',' ':'-','/':'-','—':'-','–':'-','&':'-',',':'','.':'',':':'',';':'','(':'',')':'','--':'-'}) %}
{% if product.text_2 %}

{{ macros.limpar_paragrafos(product.title) }}

{{ macros.limpar_paragrafos(product.text_2) }}

{% else %}

{{ macros.limpar_paragrafos(product.title) }}

{% endif %} {% if product.features is defined and product.features %}
{% for feature in product.features %} {% set feature_label = feature.label ?? feature.col1 ?? '' %} {% set feature_text = feature.text ?? feature.col2 ?? '' %}
{% if feature_label %}

{{ feature_label }}

{% endif %} {% if feature_text %}

{{ feature_text }}

{% endif %}
{% endfor %}
{% endif %} {{ 'btn.entrar_contacto'|t }}
{% if product_img %} {{ product_img.title }} {% endif %}
{% endfor %} {% endif %} {# ========================= SEC 3 — CAPACIDADE TÉCNICA products_section_3: - section_subtitle - section_title - text - image ========================= #} {% set sec3 = entry.products_section_3.one() ?? null %} {% if sec3 %} {% set sec3_img = sec3.image.one() ?? null %}
{% if sec3_img %} {{ sec3_img.title }} {% endif %}
{% if sec3.section_subtitle %}

{{ macros.limpar_paragrafos(sec3.section_subtitle) }}

{% endif %} {% if sec3.section_title %}

{{ macros.limpar_paragrafos(sec3.section_title) }}

{% endif %} {% if sec3.text %}

{{ macros.limpar_paragrafos(sec3.text) }}

{% endif %}
{% endif %} {# ========================= SEC 4 — CTA products_section_4: - section_title - text - btn_text - btn_link - btn_text_2 - btn_link_2 - image ========================= #} {% set sec4 = entry.products_section_4.one() ?? null %} {% if sec4 %} {% set sec4_img = sec4.image.one() ?? null %} {% set sec4_btn_href = sec4.btn_link.url ?? (sec4.btn_link ?? '#') %} {% set sec4_btn_2_href = sec4.btn_link_2.url ?? (sec4.btn_link_2 ?? '#') %}
{% if sec4.section_title %}

{{ macros.limpar_paragrafos(sec4.section_title) }}

{% endif %} {% if sec4.text %}

{{ macros.limpar_paragrafos(sec4.text) }}

{% endif %}
{% if sec4.btn_text %} {{ macros.limpar_paragrafos(sec4.btn_text) }} {% endif %} {% if sec4.btn_text_2 %} {{ macros.limpar_paragrafos(sec4.btn_text_2) }} {% endif %}
{% endif %} {% endblock %}