templates/web/homepage/index.html.twig line 1

  1. {% extends "base.html.twig" %}
    
    {% block description %}
        {{ category.description }}
    {% endblock %}
    
    {% block body %}
        {% for label, messages in app.flashes(['success', 'warning']) %}
            {% for message in messages %}
                <div class="alert-{{ label }}">
                    {{ message }}
                </div>
            {% endfor %}
        {% endfor %}
        {% if '@@FORM@@' in category.html|raw %}
            {% set content =  replaced_content|raw %}
            {% for label, messages in app.flashes(['success', 'warning']) %}
                {% for message in messages %}
                    {% set content = content|replace({"@@FORM@@": '<div class="flash-'~label~'">
                        '~message~'
                    </div>@@FORM@@'}) %}
                {% endfor %}
            {% endfor %}
            {% set content =  content|replace({"@@FORM@@": form(contact_form)})|raw %}
    
            {% if '@@NEWS@@' in content|raw %}
                {% set content =  content|replace({"@@NEWS@@":  render(path('web_homepage_news'))})|raw %}
            {% endif %}
    
            {% if '@@NEW_PRODUCTS@@' in content|raw %}
                {% set content =  content|replace({"@@NEW_PRODUCTS@@":   include('web/homepage/_new_publications.html.twig')})|raw %}
            {% endif %}
    
            {{ content|raw }}
    
        {% else %}
            {% set replaced_content = category.html|raw %}
            {% if '@@NEWS@@' in replaced_content %}
                {% set replaced_content =  replaced_content|replace({"@@NEWS@@":  render(path('web_homepage_news'))})|raw %}
            {% endif %}
    
            {% if '@@NEW_PRODUCTS@@' in replaced_content|raw %}
                {% set replaced_content =  replaced_content|replace({"@@NEW_PRODUCTS@@":   include('web/homepage/_new_publications.html.twig')})|raw %}
            {% endif %}
    
            {{ replaced_content|raw }}
    
        {% endif %}
    {% endblock body %}
    
    {% block javascripts %}
        {{ parent() }}
        {% if category.javascript %}
            <script type="text/javascript">
                {{ category.javascript | raw }}
            </script>
        {% endif %}
    {% endblock %}