Overriding Some Templates
Although we know how to create a child theme to extend an existing one, we would love to customize some of the installed modules’ templates or assets to make them look like the rest of our child theme. As you can imagine, the best practice for this is certainly not to directly modify the modules’ templates or assets in the module directories. We will learn, in this chapter, the most efficient and clean way to customize the assets and templates.
Let’s follow these steps to discover the best practices for module template/asset overriding from a theme:
- Overriding a module template from a (child) theme
- Overriding a module CSS asset from a (child) theme
- Overriding a module JavaScript asset from a (child) theme
By the end of this chapter, we will know how to override any module template or asset in a clean and efficient way, so as to keep the module updatable and without having any impact on other themes.