Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
How to overwrite a html-element but keep the rest of a block?

I am extending a twig-template where i want to replace the line

<div class="container">

with

<div class="container-fluid">

Twig-template

{% block layout_main_navigation %}
    <div class="main-navigation"
         id="mainNavigation"
         data-flyout-menu="true">
        {% block layout_main_navigation_navbar %}
            <div class="container"> <!-- This line should be replaced -->
                {% block layout_main_navigation_menu %}
                    ...
                {% endblock %}
            ...
        {% endblock %}
        ...
{% endblock %}

I tried to overwrite the layout_main_navigation by copying everything and changing the class of the div. But i am not happy with that solution as i have to copy and overwrite a lot blocks.

How can i achieve replacing the class of the div and overwrite as less block as possible?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can override the block layout_main_navigation_navbar, add the div element with the desired class container-fluid and then include the original content of the block layout_main_navigation_menu using the parent() function:

{% block layout_main_navigation_navbar %}
    <div class="container-fluid">
        {% block layout_main_navigation_menu %}
            {{ parent() }}
        {% endblock %}
    </div>
{% endblock %}

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda