M
M
magary42017-04-21 10:45:19
symfony
magary4, 2017-04-21 10:45:19

Twig block inheritance?


there is a blocks.html.twig file
, it defines a couple of dozen blocks for all occasions,
one of them

{% block maplocation_field %}
{% spaceless %}
<div {{ block( 'field_attributes' ) }}>
    {% set defaultWidth = '500px' %}
    {% set defaultHeight = '200px' %}
    {% set defaultShowMap = true %}
    .  .  . еще много строк

I do in my template
{% extends '::blocks.html.twig' %}

{% block maplocation_field %}
{% spaceless %}

you need to redefine only defaultWidth and then so that everything is taken from the parent block
how to do this if possible?
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question