SlideShare a Scribd company logo
The second part of:
HOW TO
CREATE THEME IN
MAGENTO 2 A publication of
Continuing part 1, part 2 of “How to create theme in Magento 2” will guide you
through steps by steps to configure and fundamental elements when creating theme.
Part 2
Continuing part 1, part 2 of “How to create theme in Magento 2” will guide you
through steps by steps to configure and fundamental elements when creating theme.
Part 2
See part 1 of this
tutorial here
2. Configure and
create a theme folder
- Create a theme folder in design folder as the structure below:
-app/design/<area>/<vendorName>/<newTheme>/
Example: /app/design/frontend/Magento/magestore
- Declare theme:
Create a file theme.xml in Magestore theme folder that you’ve just created and
declare information including: theme, version, parent theme (if it is a inherited
theme)
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"xsi:noNamespaceSchemaLocation="../../../../../lib/int
ernal/Magento/Framework/Config/etc/theme.xsd">
<title>Magestore Theme</title> <media>
<preview_image>media/preview.jpg</preview_image> </media>
</theme>
- Create a photo to preview for the new theme: magestore.png
We have a photo file as follows:
/app/design/frontend/Magento/magestore/media/theme/preview/magestore.png
Otherwise, there will be an error alert for not finding photos.
- Create a file composer.json in the theme folder
- In backend, go to Content > Design > Themes to see the new theme
- Configure Images (Optional)
In the file view.xml, the size of product photos in frontend will be configured.
In the new theme folder, the new folder <etc> is just created
app/design/<area>/<vendorName>/<newTheme>/etc/
- Configure Images (Optional)
In the file view.xml, the size of product photos in frontend will be configured.
In the new theme folder, the new folder <etc> is just created
app/design/<area>/<vendorName>/<newTheme>/etc/
Read this blog post with
detailed example
- Create an image folder:
+ In the theme, there are some static folders need to be added to the
image folder
+ Create folder <web> and folder <image> in the folder <web>
App/design/<area>/<vendorName>/<newTheme>web/images/
Example: /app/design/frontend/Magento/magestore/web/images/
Add a logo image to the theme:
Go to: app/design/<area>/<vendorName>/<newTheme>web/images/
Example: /app/design/frontend/Magento/magestore/web/images/
Copy the image with the name logo.png to the folder:
Example: logo.png
Magento will automatically set file logo.gif as the logo image. If you don’t want it
automatically, then create the following file:
Find and copy the file /Magento_Theme/layout/default.xml in the default theme
to the folderapp/design/<area>/<vendorName>/<newTheme>/
There will be the following path:
/app/design/frontend/Magento/magestore/Magento_Theme/layout/default.xml
Add this code to the file:
<referenceBlock name="logo"> <arguments>
<argument name="logo_file"
xsi:type="string">images/logo.png</argum
ent> </arguments> </referenceBlock>
And the result will be:
And the result will be:
- Go to Configuration then use the theme you just created:
Go to Store > Configuration > Design in Design Theme, choose the new theme:
Then Save Configuration.
So we have finished creating a new theme folder structure, the following part will
be steps to customize your own theme. Let’s move!
3. Fundamental
customization
elements
In order to customize CSS , copy files that are inherited from parent theme or
from the default theme to your theme folder.
Example: Go to theme folder /app/design/frontend/Magento/blank, copy the
folder web/css
Customize CSS:
In order to customize CSS , copy files that are inherited from parent theme or
from the default theme to your theme folder.
Example: Go to theme folder /app/design/frontend/Magento/blank, copy the
folder web/css
Customize CSS:
Paste the theme folder
Go to the folder /lib/web/css/source/lib copy the file lib.css then go to lib
folder in Magestore theme
In the folder app/design/frontend/Magento/magestore/web/css/ , open the
file style.less, then edit code as follows:
After that, create a file mytheme.less in the source folder:
We have a file path:
app/design/frontend/Magento/magestore/web/css/source/mytheme.less
Insert the following code (code in LESS language)
After deleting static folder and <var cache> folder
/pub/static/frontend/Magento/magestore
/var
Refresh your browser and we have background web color:
Customize template module:
You can also customize any module’s html, for example, if you want to customize
frontend of module Magento_Catalog, go to the
folder app/code/Magento/Catalog/view/frontend/ of the module, copy folders: layout,
templages, web to your new theme, place them in folder Magento_catalog with the same
name as the module’s name, as below:
Let me take an example of customizing a html containing the text “Buy this product now”
under the button “Add to Cart”
Go to
app/design/frontend/Magento/magestore/Magento_Catalog/templates/product/view/a
ddto.phtml:31, edit as follows:
Yay, we’re done studying!
blog.magestore.com
Thank youVisit Magestore Blog to
check the full version of
this tutorial & update
latest tutorials about
Magento 2
Magestore Blog: How to
Create theme in Magento 2

More Related Content

What's hot

Sergii Shymko - Code migration tool for upgrade to Magento 2
Sergii Shymko - Code migration tool for upgrade to Magento 2Sergii Shymko - Code migration tool for upgrade to Magento 2
Sergii Shymko - Code migration tool for upgrade to Magento 2
Meet Magento Italy
 
Imagine recap-devhub
Imagine recap-devhubImagine recap-devhub
Imagine recap-devhubMagento Dev
 
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions DistributionSergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Meet Magento Italy
 
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Joshua Warren
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2
Mathew Beane
 
Magento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersMagento 2 Development for PHP Developers
Magento 2 Development for PHP Developers
Joshua Warren
 
How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]
M-Connect Media
 
Oleh Kobchenko - Configure Magento 2 to get maximum performance
Oleh Kobchenko - Configure Magento 2 to get maximum performanceOleh Kobchenko - Configure Magento 2 to get maximum performance
Oleh Kobchenko - Configure Magento 2 to get maximum performance
Meet Magento Italy
 
Max Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overviewMax Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overview
Meet Magento Italy
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
Mathew Beane
 
Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015
David Alger
 
Federico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionFederico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento Version
Meet Magento Italy
 
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Joshua Warren
 
Magento 2 - Getting started.
Magento 2 - Getting started.Magento 2 - Getting started.
Magento 2 - Getting started.
Aneesh Sreedharan
 
Magento 2: Modernizing an eCommerce Powerhouse
Magento 2: Modernizing an eCommerce PowerhouseMagento 2: Modernizing an eCommerce Powerhouse
Magento 2: Modernizing an eCommerce Powerhouse
Ben Marks
 
Magento 2 Development Best Practices
Magento 2 Development Best PracticesMagento 2 Development Best Practices
Magento 2 Development Best Practices
Ben Marks
 
The journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developersThe journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developers
Gabriel Guarino
 
Outlook on Magento 2
Outlook on Magento 2Outlook on Magento 2
Outlook on Magento 2
Matthias Glitzner-Zeis
 
Finding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento CodeFinding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento Code
Ben Marks
 

What's hot (20)

Sergii Shymko - Code migration tool for upgrade to Magento 2
Sergii Shymko - Code migration tool for upgrade to Magento 2Sergii Shymko - Code migration tool for upgrade to Magento 2
Sergii Shymko - Code migration tool for upgrade to Magento 2
 
Imagine recap-devhub
Imagine recap-devhubImagine recap-devhub
Imagine recap-devhub
 
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions DistributionSergii Shymko: Magento 2: Composer for Extensions Distribution
Sergii Shymko: Magento 2: Composer for Extensions Distribution
 
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2
 
Magento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersMagento 2 Development for PHP Developers
Magento 2 Development for PHP Developers
 
How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]
 
Introduction to Magento
Introduction to MagentoIntroduction to Magento
Introduction to Magento
 
Oleh Kobchenko - Configure Magento 2 to get maximum performance
Oleh Kobchenko - Configure Magento 2 to get maximum performanceOleh Kobchenko - Configure Magento 2 to get maximum performance
Oleh Kobchenko - Configure Magento 2 to get maximum performance
 
Max Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overviewMax Yekaterynenko: Magento 2 overview
Max Yekaterynenko: Magento 2 overview
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
 
Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015
 
Federico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento VersionFederico Soich - Upgrading Magento Version
Federico Soich - Upgrading Magento Version
 
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
 
Magento 2 - Getting started.
Magento 2 - Getting started.Magento 2 - Getting started.
Magento 2 - Getting started.
 
Magento 2: Modernizing an eCommerce Powerhouse
Magento 2: Modernizing an eCommerce PowerhouseMagento 2: Modernizing an eCommerce Powerhouse
Magento 2: Modernizing an eCommerce Powerhouse
 
Magento 2 Development Best Practices
Magento 2 Development Best PracticesMagento 2 Development Best Practices
Magento 2 Development Best Practices
 
The journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developersThe journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developers
 
Outlook on Magento 2
Outlook on Magento 2Outlook on Magento 2
Outlook on Magento 2
 
Finding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento CodeFinding Your Way: Understanding Magento Code
Finding Your Way: Understanding Magento Code
 

Similar to How to create theme in Magento 2 - Part 2

Designing for magento
Designing for magentoDesigning for magento
Designing for magentohainutemicute
 
How to create a simple module in Magento 2.0
How to create a simple module in Magento 2.0How to create a simple module in Magento 2.0
How to create a simple module in Magento 2.0
MageWorld
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
Kapil Dev Singh
 
Magento2 what's new in theming
Magento2 what's new in themingMagento2 what's new in theming
Magento2 what's new in theming
Waruna Viraj Perera
 
Magento2 frontend development
Magento2   frontend developmentMagento2   frontend development
Magento2 frontend development
Kapil Dev Singh
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20
Vivek chan
 
Getting started with Website Project and Sublime Text 2
Getting started with Website Project and Sublime Text 2Getting started with Website Project and Sublime Text 2
Getting started with Website Project and Sublime Text 2
Amanda Zimmer
 
How to-create-a-simple-module-in-magento-2.0
How to-create-a-simple-module-in-magento-2.0How to-create-a-simple-module-in-magento-2.0
How to-create-a-simple-module-in-magento-2.0
Daniele Crupi
 
Introduction to Mangento
Introduction to Mangento Introduction to Mangento
Introduction to Mangento
Ravi Mehrotra
 
Mangento
MangentoMangento
Mangento
Ravi Mehrotra
 
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
Artefactual Systems - AtoM
 
Easy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme IntegrationEasy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme Integration
Sankhala Info Solutions
 
M2ModuleDevelopmenteBook
M2ModuleDevelopmenteBookM2ModuleDevelopmenteBook
M2ModuleDevelopmenteBookTrọng Huỳnh
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notes
Damien Carbery
 
Best practice for magento theming by shrikant vaghela
Best practice for magento theming by shrikant vaghelaBest practice for magento theming by shrikant vaghela
Best practice for magento theming by shrikant vaghela
vijaygolani
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
Kenton Spence
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
Andy Wallace
 

Similar to How to create theme in Magento 2 - Part 2 (20)

Designing for magento
Designing for magentoDesigning for magento
Designing for magento
 
How to create a simple module in Magento 2.0
How to create a simple module in Magento 2.0How to create a simple module in Magento 2.0
How to create a simple module in Magento 2.0
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
 
Magento2 what's new in theming
Magento2 what's new in themingMagento2 what's new in theming
Magento2 what's new in theming
 
Magento2 frontend development
Magento2   frontend developmentMagento2   frontend development
Magento2 frontend development
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20
 
Getting started with Website Project and Sublime Text 2
Getting started with Website Project and Sublime Text 2Getting started with Website Project and Sublime Text 2
Getting started with Website Project and Sublime Text 2
 
How to-create-a-simple-module-in-magento-2.0
How to-create-a-simple-module-in-magento-2.0How to-create-a-simple-module-in-magento-2.0
How to-create-a-simple-module-in-magento-2.0
 
Introduction to Mangento
Introduction to Mangento Introduction to Mangento
Introduction to Mangento
 
Mangento
MangentoMangento
Mangento
 
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
 
Easy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme IntegrationEasy Guide to WordPress Theme Integration
Easy Guide to WordPress Theme Integration
 
M2ModuleDevelopmenteBook
M2ModuleDevelopmenteBookM2ModuleDevelopmenteBook
M2ModuleDevelopmenteBook
 
Creating a basic joomla
Creating a basic joomlaCreating a basic joomla
Creating a basic joomla
 
Child Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notesChild Themes (WordCamp Dublin 2017) with notes
Child Themes (WordCamp Dublin 2017) with notes
 
Best practice for magento theming by shrikant vaghela
Best practice for magento theming by shrikant vaghelaBest practice for magento theming by shrikant vaghela
Best practice for magento theming by shrikant vaghela
 
skintutorial
skintutorialskintutorial
skintutorial
 
skintutorial
skintutorialskintutorial
skintutorial
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 

Recently uploaded

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

How to create theme in Magento 2 - Part 2

  • 1. The second part of: HOW TO CREATE THEME IN MAGENTO 2 A publication of
  • 2. Continuing part 1, part 2 of “How to create theme in Magento 2” will guide you through steps by steps to configure and fundamental elements when creating theme. Part 2
  • 3. Continuing part 1, part 2 of “How to create theme in Magento 2” will guide you through steps by steps to configure and fundamental elements when creating theme. Part 2 See part 1 of this tutorial here
  • 4. 2. Configure and create a theme folder
  • 5. - Create a theme folder in design folder as the structure below: -app/design/<area>/<vendorName>/<newTheme>/ Example: /app/design/frontend/Magento/magestore - Declare theme: Create a file theme.xml in Magestore theme folder that you’ve just created and declare information including: theme, version, parent theme (if it is a inherited theme) <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance"xsi:noNamespaceSchemaLocation="../../../../../lib/int ernal/Magento/Framework/Config/etc/theme.xsd"> <title>Magestore Theme</title> <media> <preview_image>media/preview.jpg</preview_image> </media> </theme>
  • 6. - Create a photo to preview for the new theme: magestore.png We have a photo file as follows: /app/design/frontend/Magento/magestore/media/theme/preview/magestore.png Otherwise, there will be an error alert for not finding photos.
  • 7. - Create a file composer.json in the theme folder
  • 8. - In backend, go to Content > Design > Themes to see the new theme
  • 9. - Configure Images (Optional) In the file view.xml, the size of product photos in frontend will be configured. In the new theme folder, the new folder <etc> is just created app/design/<area>/<vendorName>/<newTheme>/etc/
  • 10. - Configure Images (Optional) In the file view.xml, the size of product photos in frontend will be configured. In the new theme folder, the new folder <etc> is just created app/design/<area>/<vendorName>/<newTheme>/etc/ Read this blog post with detailed example
  • 11. - Create an image folder: + In the theme, there are some static folders need to be added to the image folder + Create folder <web> and folder <image> in the folder <web> App/design/<area>/<vendorName>/<newTheme>web/images/
  • 12. Example: /app/design/frontend/Magento/magestore/web/images/ Add a logo image to the theme: Go to: app/design/<area>/<vendorName>/<newTheme>web/images/ Example: /app/design/frontend/Magento/magestore/web/images/ Copy the image with the name logo.png to the folder: Example: logo.png
  • 13. Magento will automatically set file logo.gif as the logo image. If you don’t want it automatically, then create the following file: Find and copy the file /Magento_Theme/layout/default.xml in the default theme to the folderapp/design/<area>/<vendorName>/<newTheme>/ There will be the following path: /app/design/frontend/Magento/magestore/Magento_Theme/layout/default.xml Add this code to the file: <referenceBlock name="logo"> <arguments> <argument name="logo_file" xsi:type="string">images/logo.png</argum ent> </arguments> </referenceBlock>
  • 14. And the result will be:
  • 15. And the result will be:
  • 16. - Go to Configuration then use the theme you just created: Go to Store > Configuration > Design in Design Theme, choose the new theme:
  • 17. Then Save Configuration. So we have finished creating a new theme folder structure, the following part will be steps to customize your own theme. Let’s move!
  • 19. In order to customize CSS , copy files that are inherited from parent theme or from the default theme to your theme folder. Example: Go to theme folder /app/design/frontend/Magento/blank, copy the folder web/css Customize CSS:
  • 20. In order to customize CSS , copy files that are inherited from parent theme or from the default theme to your theme folder. Example: Go to theme folder /app/design/frontend/Magento/blank, copy the folder web/css Customize CSS: Paste the theme folder
  • 21. Go to the folder /lib/web/css/source/lib copy the file lib.css then go to lib folder in Magestore theme
  • 22. In the folder app/design/frontend/Magento/magestore/web/css/ , open the file style.less, then edit code as follows:
  • 23. After that, create a file mytheme.less in the source folder: We have a file path: app/design/frontend/Magento/magestore/web/css/source/mytheme.less Insert the following code (code in LESS language)
  • 24. After deleting static folder and <var cache> folder /pub/static/frontend/Magento/magestore /var Refresh your browser and we have background web color:
  • 25. Customize template module: You can also customize any module’s html, for example, if you want to customize frontend of module Magento_Catalog, go to the folder app/code/Magento/Catalog/view/frontend/ of the module, copy folders: layout, templages, web to your new theme, place them in folder Magento_catalog with the same name as the module’s name, as below:
  • 26. Let me take an example of customizing a html containing the text “Buy this product now” under the button “Add to Cart”
  • 28. Yay, we’re done studying! blog.magestore.com
  • 29. Thank youVisit Magestore Blog to check the full version of this tutorial & update latest tutorials about Magento 2 Magestore Blog: How to Create theme in Magento 2