Chapter 3. Magento 2 Theme Layout

"Almost all quality improvement comes via simplification of design, manufacturing... layout, processes, and procedures" - Tom Peters.

Now that you've looked at what Magento has to offer in terms of themes, how themes in Magento work, and the terminology you can use to describe the various aspects of Magento themes, you can begin to look at customizing the look and feel of your store. In this chapter, we'll cover the following topics:

  • Magento 2 and Model-View-Controller architecture
  • Command-Line Interface
  • Magento 2 theme files
  • Caching system
  • Magento 2 layout system
  • Creating your first Magento 2 theme
  • Magento theme debug

Before developing your own Magento 2 theme, this chapter will explain some new concepts, resources, and tools that will assist in theme development. You'll notice very soon the importance of building a solid understanding of the Magento 2 theme infrastructure when you start to professionally build your very own Magento 2 solutions.

Magento 2 and Model-View-Controller architecture

Magento 2 uses Model-View-Controller (MVC) as the software architectural pattern, which is responsible mainly for organizing the entire system's process structure at the coding level and establishing the means for the system to be flexible and extensible.

MVC distinguishes three layers of software activities, aiming for high cohesion and loosely coupling the modules responsible for the operation of Magento 2 systems. The three layers are described as follows:

  • Model: The system modeling layer. Its main scope is handling system business rules and data persistence.
  • View: This is responsible for the user information display layer, such as the product page and contact form.
  • Controller: This is the layer that defines the main actions, requests, and responses of clients that may change the model's state and generate data views of the model layer.

Magento 2 and Model-View-Controller architecture

It's important to define these concepts so you can develop well. Even when dealing with a more technical matter (coding), it's highly recommended that you have these concepts well established. Of the three layers of the MVC architecture, Magento themes developers work mainly with the View layer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.98.13