Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Magento 2

You're reading from   Mastering Magento 2 Maximize the power of Magento 2 to create productive online stores

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785882364
Length 340 pages
Edition 2nd Edition
Languages
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Bret Williams Bret Williams
Author Profile Icon Bret Williams
Bret Williams
Jonathan Bownds Jonathan Bownds
Author Profile Icon Jonathan Bownds
Jonathan Bownds
Andre Gugliotti Andre Gugliotti
Author Profile Icon Andre Gugliotti
Andre Gugliotti
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Planning for Magento FREE CHAPTER 2. Installing Magento 2 3. Managing Products 4. Designs and Themes 5. Configuring to Sell 6. Managing Non-Product Content 7. Marketing Tools 8. Extending Magento 9. Optimizing Magento 10. Advanced Techniques 11. Pre-Launch Checklist Index

The concept of theme inheritance

A very important aspect of Magento theming is the fallback model. Theme inheritance in Magento 2.x has been completely redesigned. The primary upshot of this is that unlimited fallbacks are supported and the default directory is no longer a part of the fallback mechanism.

The fallback order is slightly different for static assets (JavaScript, Less CSS, CSS) and templates, so we'll review both of these cases in detail. Before we explain the fallback order though, we'll need to begin with how parent themes are established in theme.xml.

Configuring a parent theme in theme.xml

This is new and central to the new theme fallback model. In any given theme, you have the option of identifying the parent theme. This is done in the theme.xml file, in the root directory of the theme. The following is an example of what text from a sample theme.xml file might look like:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image