Working with template files
The time for theory is over; it’s time for practice. The first step for us, when working with templates, is to make sure we are in the developer mode and that we’ve disabled the block_html
cache.
To do this, we need to run the following commands:
php bin/magento cache:disable block_html full_page php bin/magento deploy:mode:set developer
Important note
Some, but not all, blocks can use the AC caching system. The caching of processed template files, which is in HTML code associated with blocks, is simply called block_html
cache, for short.
Let’s start with the question you might have asked yourself a moment ago: So how can I change the template file if it is assigned in PHP code?
It is very simple, and there are two ways we can do it:
- Copy the
template
file from theModule
directory area (frontend
) into ourtheme
directory, keeping the module name and template path the same as they are in the module. In this case...