From 52344cda3b592c39ca42d1c7af2b6ae48f15ccdf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 7 Oct 2025 10:18:53 +0200 Subject: [PATCH] Create template for environment banner --- .../views/Layout/_top_banner.html.twig | 17 +++++++++++++++++ .../Resources/views/layout.html.twig | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig new file mode 100644 index 000000000..a7a74c1f8 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Layout/_top_banner.html.twig @@ -0,0 +1,17 @@ +{% if chill_main_config.top_banner is defined and chill_main_config.top_banner.text is defined %} + {% set banner_text = '' %} + {% set current_locale = app.request.locale %} + + {% if chill_main_config.top_banner.text[current_locale] is defined %} + {% set banner_text = chill_main_config.top_banner.text[nl] %} + {% else %} + {% set banner_text = chill_main_config.top_banner.text|first %} + {% endif %} + + {% if banner_text %} +
+ {{ banner_text }} +
+ {% endif %} +{% endif %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig index 343c12eea..0ff39c8d9 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig @@ -26,6 +26,10 @@ + {% if chill_main_config.top_banner is defined and chill_main_config.top_banner.visible is true %} + {{ include('@ChillMain/Layout/_top_banner.html.twig') }} + {% endif %} + {% if responsive_debug is defined and responsive_debug == 1 %} {{ include('@ChillMain/Layout/_debug.html.twig') }} {% endif %}