{# app/templates/platform/sections/_hero.html #} {# Hero section partial with multi-language support #} {# Parameters: - hero: HeroSection object (or dict) - lang: Current language code (passed from parent template) - default_lang: Fallback language (passed from parent template) #} {% macro render_hero(hero, lang, default_lang) %} {% if hero and hero.enabled %}
{# Badge #} {% if hero.badge_text and hero.badge_text.translations %} {% set badge = hero.badge_text.translations.get(lang) or hero.badge_text.translations.get(default_lang) %} {% if badge %}
{{ badge }}
{% endif %} {% endif %} {# Title #} {% set title = hero.title.translations.get(lang) or hero.title.translations.get(default_lang) or '' %} {% if title %}

{{ title }}

{% endif %} {# Subtitle #} {% set subtitle = hero.subtitle.translations.get(lang) or hero.subtitle.translations.get(default_lang) or '' %} {% if subtitle %}

{{ subtitle }}

{% endif %} {# Buttons #} {% if hero.buttons %}
{% for button in hero.buttons %} {% set btn_text = button.text.translations.get(lang) or button.text.translations.get(default_lang) or '' %} {% if btn_text and button.url %} {{ btn_text }} {% if button.style == 'primary' %} {% endif %} {% endif %} {% endfor %}
{% endif %}
{# Background decorations #}
{% endif %} {% endmacro %}