Hi !
When building a theme that inherits Antimatter, I think there's no clean way to customise a specific block of the base template.
You can only create a partials/base.html.twig file in the subtheme to overwrite the base layout, but then you overwrite the whole file (which means you have to copy all the content of the base theme, which is bad in terms of updatability).
A much cleaner way would be to be able to override a specifc block only. This would be very easy to achieve with a small modification to Antimatter. It would need to move the content of partials/base.html.twig to a new partials/abstract_base.html.twig, and to set the content of partials/base.html.twig to {% extends 'partials/abstract_base.html.twig' %}.
Then, child themes could override some blocks, by providing their own partials/base.html.twig, containing for example :
{% extends 'partials/abstract_base.html.twig' %}
{% block footer %}
<footer id="footer">
MY FOOTER
</footer>
{% endblock %}
This way, if the antimatter theme is updated, all the rest of the base layout is kept.
I'm not completely sure, but I think this would be perfectly retro-compatible. What do you think ? If you like it, I can issue a PR.
Bests,
Olivier
Hi !
When building a theme that inherits Antimatter, I think there's no clean way to customise a specific block of the base template.
You can only create a
partials/base.html.twigfile in the subtheme to overwrite the base layout, but then you overwrite the whole file (which means you have to copy all the content of the base theme, which is bad in terms of updatability).A much cleaner way would be to be able to override a specifc block only. This would be very easy to achieve with a small modification to Antimatter. It would need to move the content of
partials/base.html.twigto a newpartials/abstract_base.html.twig, and to set the content ofpartials/base.html.twigto{% extends 'partials/abstract_base.html.twig' %}.Then, child themes could override some blocks, by providing their own
partials/base.html.twig, containing for example :This way, if the antimatter theme is updated, all the rest of the base layout is kept.
I'm not completely sure, but I think this would be perfectly retro-compatible. What do you think ? If you like it, I can issue a PR.
Bests,
Olivier