Fallback system
Let’s understand how the fallback system works in Magento 2. Begin by changing the file name of logo.svg
to logo.old.svg
in the theme you’ve created. This action will help illustrate the process.
Once you do this, clear the static content by doing either of the following:
- Remove the
pub/static/frontend
folder - Run the
php bin/magento deploy:mode:set
developer
command
Now, refresh your browser cache, and you will see the default Magento 2 logo instead of the one in your theme:
Figure 3.18 – Default Logo in customized theme
So, what is going on here? This is the fallback system in work! When the browser has requested the static file https://app.packt1.test/static/frontend/packt/theme1/en_US/images/logo.svg, it looked where the file can be located in the following way:
- Select the theme folder
- See the parent theme folder
- See the parent’s parent theme folder (if set); this can...