Which solution is better and recommended for short lines? To define a block and allow the user to override its contents, for example:
<title>{% block title %}{% endblock %}</title>
or make a block of variables, set their default values ββand allow the user to import the reset variable that he wants, for example:
base template:
{% block variables %} {% set meta.title = '' %} {% endblock %} <title>{{ meta.title }}</title>
user template:
{% block variables %} {{ parent() }} {% set meta.title = 'some title' %} {% endblock %}
source share