Magento is undoubtedly one of the better web commerce portals available to the world. The key to Magento’s success is through the extreme ease of customizability and management that even tech novices can easily master.
It has not been long since Magento 2.0 was launched. As the world delves into unraveling the vast expanse of features in the 2.0 release let me quickly run you through a neat set of steps that will help you in creating themes in Magento 2.0
<magento root folder>/app/design/frontend
Create a new directory named your vendor name:
Under the vendor directory, create a directory to name your theme.
Here: “Daffodil” is vendor name and “daffodil” is theme name
Add theme.xml to your theme folder:
It should contain, at least, the theme name and the parent theme name (if theme inherits any other theme). Optionally you can specify where the theme preview image is stored.
<title>Daffodil theme</title> <!-- your theme's name -->
<parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an
existing theme -->
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview
If you want to distribute your theme as a package, add a composer.json file to the theme directory:
To register your theme in the system, go to your theme directory and add a registration.php file with the following content:
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
Your theme is now created which you can check under Admin. For this go to Content -> Design -> Themes. Make sure your theme appears in the theme list.
Go to Stores -> Configuration -> Design.
In the Scope drop-down field, select the store view where you want to apply the theme.
On the Design Theme tab, select your newly created theme in the Design Theme drop-down
Click Save Config.
Cheers! You have created your very own theme in Magento 2.0!
Easy, isn’t it? There are tons of new features that we have been playing around with Magento 2.0 since its release while delivering projects for our clients.
Get in touch with us if you have a Magento idea in mind or wish to inquire more about Magento 2.0. For more of such posts around the latest technologies that drive the world, sub to the blog and we will keep you updated.