Is there a generally \"good\" way to achieve this functionality? I have read about the \'use\' tag, which seems like the best option so far, but I still don\'t like that it
I found a solution. Use the block() function to get the child's block content and pass it to header.html.twig as a variable in the include statement:
#base.html.twig
{% include 'elements/header.html.twig' with {page_title: block('page_title')} %}
{% block content %}{% endblock %}
{% include 'elements/footer.html.twig' %}
#header.html.twig
This is my header
{% if page_title is empty %}
Default Page Title
{% else %}
{{ page_title }}
{% endif %}
#index.html.twig
{% extends 'layouts/base.html.twig' %}
{% block page_title %} This is my overridden page title {% endblock %}
{% block content %} here is the index page content {% endblock %}