{# Section partial: Testimonials #} {# Parameters: - testimonials: dict with enabled, title, subtitle, items - lang: Current language code - default_lang: Fallback language #} {% macro render_testimonials(testimonials, lang, default_lang) %} {% if testimonials and testimonials.enabled %}
{# Section header #}
{% set title = testimonials.title.translations.get(lang) or testimonials.title.translations.get(default_lang) or '' %} {% if title %}

{{ title }}

{% endif %}
{# Testimonial cards — use .get() to avoid dict.items() method collision with JSON dicts #} {% set testimonial_items = testimonials.get('items', []) if testimonials is mapping else [] %} {% if testimonial_items %}
{% for item in testimonial_items %}
{% for _ in range(5) %} {% endfor %}
{% set content = item.content %} {% if content is mapping %} {% set content = content.translations.get(lang) or content.translations.get(default_lang) or '' %} {% endif %}

"{{ content }}"

{% if item.avatar %} {% else %}
{% set author = item.author %} {% if author is mapping %}{% set author = author.translations.get(lang) or author.translations.get(default_lang) or '?' %}{% endif %} {{ author[0]|upper if author else '?' }}
{% endif %}
{% set author = item.author %} {% if author is mapping %}{% set author = author.translations.get(lang) or author.translations.get(default_lang) or '' %}{% endif %}

{{ author }}

{% set role = item.role %} {% if role is mapping %}{% set role = role.translations.get(lang) or role.translations.get(default_lang) or '' %}{% endif %} {% if role %}

{{ role }}

{% endif %}
{% endfor %}
{% else %}

Coming soon

{% endif %}
{% endif %} {% endmacro %}