koi finance
avgle
best porn
Computers and TechnologyServices

Theme concept in Magento 2

Electronic commerce plays a very important role in our life especially in this Covid-19 pandemic. As we all know, it is not safe to go out to buy essentials for us. In this case, many sellers offer online shopping for our goodwill.

Magento is one of the best open source platforms for e-commerce. This gives users great opportunities to control the appearance and functionality of the storefront. This provides a lot of tools and features like marketing, search engine optimization (SEO), catalog management, etc.

Magento 2 is an improved and improved version of Magento.

Let’s continue to personalize our showcase:

What is the theme in Magento 2?

The theme in Magento 2 is responsible for the appearance of the frontend as well as the backend. They use a combination of PHP, XML, HTML, CSS, and JavaScript to achieve the look you want. Themes replace or extend existing PHP, HTML, CSS, and JavaScript while providing additional functionality.

Magento 2 provides us with a predefined theme, namely “Luma” and “Blank”. Magento gives us the option to create a new theme for our store or we can also inherit one from Luma and Blank.

How to create a theme in Magento 2?

We will learn how to create a new theme based on “Magento Luma”.

To create a new theme based on “Magento Blank” or “Magento Luma”, we need to create a folder for the theme. Let’s talk about the folder structure:

 

app/design/frontend/
 ├── <Vendor>/
 │   │   ├──...<theme>/
 │   │   │   ├── ...
 │   │   │   ├── ...

 

<vendor> is the name of the vendor or company that offers that particular theme.

<theme> is the name of the theme.

For example :

<provider> => Tutorial

<theme> => Simple

Now the folder will be:

 

app/design/frontend/
 ├── Tutorial/
 │   │   ├──...Simple/
 │   │   │   ├── ...
 │   │   │   ├── ...

 

  1. theme.xml
  2. registration.php

Declare the theme in the theme.xml file:

 

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
      <title>Tutorial Simple</title>
      <parent>Magento/luma</parent> 
</theme>

 

<title> is the name of the theme

<parent> is the parent theme.

and we can also add a preview image of the theme to the theme.xmlfile.

 

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
   <title>Tutorial Simple</title>
   <parent>Magento/luma</parent>
   <media>
      <preview_image>media/preview.jpg</preview_image> 
   </media>
</theme>

 

To save our theme in the system, we need to add a registration.phpfile in the theme directory with the following code:

 

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use \Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/Tutorial/Simple, __DIR__);

 

Composer is a PHP dependency management tool. It allows you to declare the libraries that your project depends on and it will manage (install / update) them for you.

 

{
    "name": "Tutorial/Simple",
    "description": "N/A",
    "config": {
        "sort-packages": true
    },
    "require": {
        "php": "~7.2.0||~7.3.0",
        "magento/framework": "*",
        "magento/theme-frontend-blank": "*"
    },
    "type": "magento2-theme",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

 

Product image sizes and other properties used on the storefront are configured in a view.xmlconfiguration file. It is required for a theme, but is optional if it exists in the parent theme.

Configure all storefront product image sizes in the view.xmlfile. For example, you can square the product images in the category grid view by specifying a size of 250 x 250 pixels:

 

<image id="category_page_grid" type="small_image">
    <width>250</width>
    <height>250</height>
</image>

 

Create directories for static files:

The theme will likely contain several types of static files:

    • fashions
    • Fonts
    • Javascript
    • Pictures

 

app/design/frontend/Tutorial/Simple/
├── web/
│ ├── css/
│ │ ├── source/ 
│ ├── fonts/
│ ├── images/
│ ├── js/

 

 

app/design/frontend/Tutorial/
├── Simple/
│   ├── etc/
│   │   ├── view.xml
│   ├── web/
│   │   ├── css/
│   │     ├── source/ 
│   |   ├── fonts/
│   |   ├── images/
│   |   ├── js/
│   ├── registration.php
│   ├── theme.xml
│   ├── composer.json

 

 

$ php bin/magento setup:upgrade

 

Log in to Magento Admin> Content> Design> Configuration> click Edit> Default Theme> Under the drop-down list of the applied theme, select your theme> Save configuration

After that we have to clear the magento cache

 

$ php bin/magento cache:flush
istanbul escort

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
papaitorotisserie.comAnadolu Yakası Escortataşehir escorttortuga casinowildsultan casinowildtornadogreenspinpuntcasinoinclavecasinosgambino slotsonlinegamblingcrypto gamesborgata casinoplanet 7 casinonewbahissetrabetbetzulatumbetjasminbetikimisliretrobetbetofficeHorus casinoDivas casinoIntense casinoSpeedy casinobetonredbizbetsilksleura.comAksu Escortcasino sitelerirestbetbetgarbetonreddinamobetajaxbetşarjlı vidalamapijama takımıistanbul escortdeneme bonusuzlot girişküçükçekmece escortşişli escortcasibomİzmir escortİzmir bayan escortEscort bayan izmirİzmir escort bayanEscort izmirankara escortGrandpashabetbetwoonspincoGrandpashabetistanbul escortmasalbet üyelikpin upbetmatik girişroketbet girişmostbet girişxslot üyelikotobet üyelikpin up üyelikbetmatik yeni giriş adresiJojobetroketbet mobilcasibom girişbetingo twitterzlot girişretrobet üyelikhedefbet girişcasibomchumba casinochumba casino $100 free playbakırköy escortcoinbarholiganbetpulsz casino real moneyhigh 5 casino real moneystakepulsz casinoding ding ding casinofunrize loginmcluck casino loginhello millionsfixbetdeneme bonusu veren sitelermatadorbet girişpadişahbet girişbetwoonmatadorbetMatbet Girişmatbetkocaeli escortbetciocasinolevantbettiltmatbetjackpot party casinogolden hearts casino logintarafbetonwinonwin girişbetkanyonzlot girişzlotextrabetcasibom giriştrendbetgoldenbahiscasinomaxi girişmobilbahis girişbets10 girişcasibom girişbetnanobetparkjojobet güncel girişpinbahis güncel girişrestbet güncel girişgrandpashabet güncel girişmatadorbet güncel girişrestbet güncel girişrestbet güncel girişholiganbet güncel girişmarsbahis giriş güncelonwin güncel girişsahabet güncel girişjojobet güncel girişsekabet güncel girişmatbet güncel girişmarsbahiscasibomjojobetcasibomsuperbetinvevobahisbetparkbetparkotobet güncel girişultrabet güncel girişbetparkparibahistipobet güncel girişmeritking girişmatadorbet girişgrandpashabet girişsahabet girişonwin girişjojobetjojobetsekabet girişholiganbet girişsekabet girişjojobet girişmatbet girişcasibomjojobetgalabetmostbet güncel girişmeritbet güncel girişolabahiscasibomimajbet girişdinamobet günceldumanbetcasibom girişcasibombetparkextrabetcasibombetpark girişzbahiszbahisxslotxslotbetturkeybetturkeyselçuksportsmarsbahis girişpusulabetmarsbahisbetturkeyonwincashman casinopusulabetimajbet güncel girişmatadorbetonwinmegaparicasinolevantcasinolevantcasinolevantcasibomsekabetbursa escortsuperbetinMarsbahis güncel girişmatbet girişmeritking girişmeritking girişcasino sitelerithe money factory casinocaesars social casino logincashman slotschanced casinovegas gemsluckybird casinomoonspin casino no deposit bonuscash frenzycash frenzy free slotsclub vegasrolling riches casinohorseplayhorseplay loginartemisbet güncel girişGrandpashabetgrandpashabetgrandpashabetcratosroyalbetGrandpashabetbetwooncasibom giriştao fortune casinocrown coins casinocrown coins casinojackpotafortune wheelzfortune wheelz loginreal prizeslots era jackpotcarnival citi sweepstakesnolimitcoins casinothe money factory casinoyay casinoMarsbahisMarsbahisjojobet güncel girişjojobetholiganbet güncel girişmarsbahis güncel girişjojobet güncel girişcasibom güncel girişgrandpashabet güncel girişmatadorbet güncel girişsahabet güncel girişsekabet güncel girişonwin güncel girişmatbet güncel girişsavoybettingcoinbarsweeps casinoscoinbarbetsatbetboobetinebetwoonbetparkasyabahiscasinomaxijojobet girişcasibommobilbahisbets10asyabahiscasinomaximarsbahis girişNerobetsweeps slotsfree scprogressive sweep slotsfree sweepstakes casinofree sc casino real moneysweeps casinossweeps casinosweep coin casinosocial casino no depositsweeps coinssweepstakes casino real moneysweep coins casinossc casinofree sc coins casinoonline casinos free scfree sweeps coinslist of sweepstakes casinosCasibom Casino SiteleriimajbetzlotBetciocasibomextrabetcasibommeritkingzbahistambetmng kargo takipdeneme bonusu veren sitelergrandpashabet güncel girişcasibommeritkingcasibom girişmatadorbetgrandpashabetsahabettümbetonwindeneme bonusu veren siteler forumsekabetcasibom girişdeneme bonusu veren siteler 2024casibom girişcasibom ile kazanCasibom Kampanyalarcanlı bahisholiganbetjojobetcasibom girişcanlı maç izlecasibom girişcasibom mobil girişcasibom yeni girişsekabet giriştaraftarium24Ataşehir Escortselcuksportscasibomcasibom girişbettiltmatbetimajbetmeritkingcasibom giriştürk pornomarsbahisimajbet güncel girişcasibom güncel girişcasibomcasibom girişcasibom bonuslarcasibom mobil girişbedava bonus veren sitelersuperbahis güncel girişjojobetPusulabet istanbul eskortjustin tvescortescort bayanbayan escort
casino siteleri canlı casino siteleri 1xbet canlı casino siteleri