Theme inheritance : extend parent template


I use theme inheritance (parent theme is antimatter) as described here : . I just want to change the content of header block in templates/partials/base.html.twig. I try to do this without copying the entire base.html.twig file.
Instead, I want to extend antimatter’s base.html.twig and just modify header block content. I naively try this (in templates/partials/base.html.twig in my new theme) :

{% extends "partials/base.html.twig" %}

{% block header %}
    new header content here
{% endblock %}

Of course, this does’nt work. Grav extends base.html.twig in new theme (over and over again until php crashes) and not in antimatter. I also tried …/…/antimatter/templates/partials/base.html.twig without success.

Is there any way to reference antimatter file (which has the same name) in extends tag ?

No this is not going to work as it’s an endless loop.

You could alter the page templates (default.html.twig…) to reference a yourbase.html.twig which in turns extends base.html.twig, but this is just more work than simply replacing the base template, probably.

This could easily be fixed by antimatter :

I think it’s a very common scenario if we’re serious about theme inheritance !