diff --git a/app/modules/cms/templates/cms/platform/homepage-default.html b/app/modules/cms/templates/cms/platform/homepage-default.html index 2b73f305..4a76ee81 100644 --- a/app/modules/cms/templates/cms/platform/homepage-default.html +++ b/app/modules/cms/templates/cms/platform/homepage-default.html @@ -7,6 +7,9 @@ {% from 'cms/platform/sections/_products.html' import render_products %} {% from 'cms/platform/sections/_features.html' import render_features %} {% from 'cms/platform/sections/_pricing.html' import render_pricing with context %} +{% from 'cms/platform/sections/_testimonials.html' import render_testimonials %} +{% from 'cms/platform/sections/_gallery.html' import render_gallery %} +{% from 'cms/platform/sections/_contact_info.html' import render_contact_info %} {% from 'cms/platform/sections/_cta.html' import render_cta %} {% block title %} @@ -51,6 +54,21 @@ {{ render_pricing(page.sections.pricing, lang, default_lang, tiers) }} {% endif %} + {# Testimonials Section #} + {% if page.sections.testimonials %} + {{ render_testimonials(page.sections.testimonials, lang, default_lang) }} + {% endif %} + + {# Gallery Section #} + {% if page.sections.gallery %} + {{ render_gallery(page.sections.gallery, lang, default_lang) }} + {% endif %} + + {# Contact Info Section #} + {% if page.sections.contact_info %} + {{ render_contact_info(page.sections.contact_info, lang, default_lang) }} + {% endif %} + {# CTA Section #} {% if page.sections.cta %} {{ render_cta(page.sections.cta, lang, default_lang) }} diff --git a/app/modules/cms/templates/cms/platform/sections/_contact_info.html b/app/modules/cms/templates/cms/platform/sections/_contact_info.html new file mode 100644 index 00000000..47df81be --- /dev/null +++ b/app/modules/cms/templates/cms/platform/sections/_contact_info.html @@ -0,0 +1,66 @@ +{# Section partial: Contact Information #} +{# + Parameters: + - contact_info: dict with enabled, title, email, phone, address, hours, map_embed_url + - lang: Current language code + - default_lang: Fallback language +#} + +{% macro render_contact_info(contact_info, lang, default_lang) %} +{% if contact_info and contact_info.enabled %} +
+
+
+ {% set title = contact_info.title.translations.get(lang) or contact_info.title.translations.get(default_lang) or 'Contact' %} +

+ {{ title }} +

+
+ +
+ {% if contact_info.phone %} +
+
+ 📞 +
+

Phone

+ + {{ contact_info.phone }} + +
+ {% endif %} + + {% if contact_info.email %} +
+
+ 📧 +
+

Email

+ + {{ contact_info.email }} + +
+ {% endif %} + + {% if contact_info.address %} +
+
+ 📍 +
+

Address

+

{{ contact_info.address }}

+
+ {% endif %} +
+ + {% if contact_info.hours %} +
+

+ Hours: {{ contact_info.hours }} +

+
+ {% endif %} +
+
+{% endif %} +{% endmacro %} diff --git a/app/modules/cms/templates/cms/platform/sections/_gallery.html b/app/modules/cms/templates/cms/platform/sections/_gallery.html new file mode 100644 index 00000000..97940559 --- /dev/null +++ b/app/modules/cms/templates/cms/platform/sections/_gallery.html @@ -0,0 +1,44 @@ +{# Section partial: Image Gallery #} +{# + Parameters: + - gallery: dict with enabled, title, images (list of {src, alt, caption}) + - lang: Current language code + - default_lang: Fallback language +#} + +{% macro render_gallery(gallery, lang, default_lang) %} +{% if gallery and gallery.enabled %} +
+
+ {# Section header #} +
+ {% set title = gallery.title.translations.get(lang) or gallery.title.translations.get(default_lang) or '' %} + {% if title %} +

+ {{ title }} +

+ {% endif %} +
+ + {# Image grid #} + {% if gallery.images %} +
+ {% for image in gallery.images %} +
+ {{ image.alt or '' }} + {% if image.caption %} +
+

{{ image.caption }}

+
+ {% endif %} +
+ {% endfor %} +
+ {% endif %} +
+
+{% endif %} +{% endmacro %} diff --git a/app/modules/cms/templates/cms/platform/sections/_testimonials.html b/app/modules/cms/templates/cms/platform/sections/_testimonials.html new file mode 100644 index 00000000..3863c5ed --- /dev/null +++ b/app/modules/cms/templates/cms/platform/sections/_testimonials.html @@ -0,0 +1,72 @@ +{# 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 #} + {% if testimonials.items %} +
+ {% for item in testimonials.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 %} diff --git a/app/modules/cms/templates/cms/storefront/landing-full.html b/app/modules/cms/templates/cms/storefront/landing-full.html index 1fabe953..8b1fff14 100644 --- a/app/modules/cms/templates/cms/storefront/landing-full.html +++ b/app/modules/cms/templates/cms/storefront/landing-full.html @@ -10,6 +10,34 @@ {% block alpine_data %}storefrontLayoutData(){% endblock %} {% block content %} +{# ═══════════════════════════════════════════════════════════════════ #} +{# SECTION-BASED RENDERING (when page.sections is configured) #} +{# Used by POC builder templates — takes priority over hardcoded HTML #} +{# ═══════════════════════════════════════════════════════════════════ #} +{% if page and page.sections %} +{% from 'cms/platform/sections/_hero.html' import render_hero %} +{% from 'cms/platform/sections/_features.html' import render_features %} +{% from 'cms/platform/sections/_testimonials.html' import render_testimonials %} +{% from 'cms/platform/sections/_gallery.html' import render_gallery %} +{% from 'cms/platform/sections/_contact_info.html' import render_contact_info %} +{% from 'cms/platform/sections/_cta.html' import render_cta %} + +{% set lang = request.state.language|default("fr") %} +{% set default_lang = 'fr' %} + +
+ {% if page.sections.hero %}{{ render_hero(page.sections.hero, lang, default_lang) }}{% endif %} + {% if page.sections.features %}{{ render_features(page.sections.features, lang, default_lang) }}{% endif %} + {% if page.sections.testimonials %}{{ render_testimonials(page.sections.testimonials, lang, default_lang) }}{% endif %} + {% if page.sections.gallery %}{{ render_gallery(page.sections.gallery, lang, default_lang) }}{% endif %} + {% if page.sections.contact_info %}{{ render_contact_info(page.sections.contact_info, lang, default_lang) }}{% endif %} + {% if page.sections.cta %}{{ render_cta(page.sections.cta, lang, default_lang) }}{% endif %} +
+ +{% else %} +{# ═══════════════════════════════════════════════════════════════════ #} +{# HARDCODED LAYOUT (original full landing page — no sections JSON) #} +{# ═══════════════════════════════════════════════════════════════════ #}
{# Hero Section - Split Design #} @@ -255,4 +283,5 @@
+{% endif %} {% endblock %}