Template file locations
Time to dive into template files. A PHTML template file is typically associated with a block related to a specific module on a rendered page. It’s worth noting that a single template can be linked to multiple blocks, even those of different classes, although this isn’t standard practice. For ease of maintenance, a 1:1 association between templates and blocks is generally preferred. We already know that blocks are added and defined by Layout XML. In the previous chapter, I’ve added this code in order to display a block with a template on the homepage:
<page [...]"> <referenceContainer name="content"> <container [...] > <block name="packt1.block" template="Magento_Theme::packt1.phtml" /> <...