Book Image

Mastering Magento 2 - Second Edition

By : Bret Williams, Gugliotti, Jonathan Bownds
Book Image

Mastering Magento 2 - Second Edition

By: Bret Williams, Gugliotti, Jonathan Bownds

Overview of this book

The long-awaited release of the world's most popular online solution, Magento 2, is now out with an all new interface and several enhancements. This book offers you advanced guidance on managing, optimizing, and extending your store while taking advantage of the new features of Magento 2. This is a comprehensive guide to using the all new features and interface of Magento 2 to build, extend, and design online stores. From planning your Magento installation through to advanced techniques designed to make your store as successful as possible, this book is your roadmap to managing your Magento store. Focusing on Magento's Community version, the book covers everything from creating and managing multiple stores to fine-tuning Magento for speed and performance. You’ll learn how to manage categories, products, design themes, extensions, and more.
Table of Contents (13 chapters)
12
Index

Working with theme variants


Let's assume we have created a new design package called sportswear_package. Within this design package, create a new theme and call it sportswear_theme. Our new design package file hierarchy, in /app/design/, might resemble the following hierarchy:

app/
  design/
    frontend/
      Magento/
        blank/
        luma/      
      sportswear_package/
        sportswear_theme/

Because we want to use the blank theme as a starting point, the theme.xml in the root directory of our theme will look something like this:

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Config/etc/theme.xsd">
    <title>Sportswear Theme</title>
    <parent>Magento/blank</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

However, let's also take one more customization step here. We can create variations...