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ı Escorttortuga casinowildsultan casinowildtornadogreenspinpuntcasinoinclavecasinosgambino slotsonlinegamblingcrypto gamesborgata casinoplanet 7 casinonewbahissetrabetbetzulatumbetjasminbetikimisliretrobetbetofficeHorus casinoDivas casinoIntense casinoSpeedy casinobetonredbizbetsilksleura.comAksu Escortcasino sitelerirestbetbetgarbetonreddinamobetajaxbetdeneme bonusuküçükçekmece escortistanbul escortmasalbet üyelikpin upbetmatik girişroketbet girişmostbet girişxslot üyelikotobet üyelikpin up üyelikbetmatik yeni giriş adresiroketbet mobilcasibom girişbetingo twitterretrobet üyelikhedefbet girişchumba casinochumba casino $100 free playbakırköy escortholiganbetpulsz casino real moneypulsz casinofunrize loginjackpot party casinogolden hearts casino loginonwinonwin girişcashman casinocasibom girişthe money factory casinocaesars social casino loginchanced casinovegas gemsluckybird casinomoonspin casino no deposit bonuscash frenzycash frenzy free slotsrolling riches casinohorseplayhorseplay logingrandpashabetgrandpashabetgrandpashabetcratosroyalbetgrandpashabetbetwoontao fortune casinocrown coins casinocrown coins casinojackpotafortune wheelzfortune wheelz loginreal prizeslots era jackpotcarnival citi sweepstakesnolimitcoins casinothe money factory casinoyay casinoholiganbet girişholiganbet girişsweeps casinossweeps 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 casinosextrabetcasibomhaartransplantatiehttps://www.bakirkoyfal.com/onwinmatbetsekabetbetebetonwinbetebetbetebetdumanbetmavibetsahabet girişsekabet güncel girişcasibomMarsbahisholiganbethttps://fatihescortsitesi.com/matbetholiganbet giriştaraftariumjustin tvselcuksportshdbets10 officialbetifysimsinoOdeonbetvaycasino,vaycasino girişcasibomstarzbet twitterbahisbeycasibomonwinmarsbetcasino siteleriBets10 güncel girişleonbet üyelikCASİJojobet GirişSekabetcasibommatbetsugar casinocasibomkingroyalcasibomcasibom girişjojobetholiganbet girişİzmir EscortBetgaranti girişCratosslotporno izlebetsatmatadorbetmarsbahis girişsahabetdeneme bonusu veren siteler 2025casibom güncel girişcasibom girişcasibom güncel girişcasibom girişcasibom güncel girişdeneme bonusu veren sitelermatbetcasibom 866 comjojobet girişballettea tropazTHE TIDES LABmegabahis güncel girişdeneme bonusu veren sitelermarsbahisdeneme bonusu veren siteler 2024matbetextrabetjojobetholiganbetkingroyalonwinjojobetgoogle hit botucasibom güncel girişcasibomcasibom girişmatadorbetsahabet sekabetonwinmarsbahismarsbahishacklinkmarsbahis girişdeneme bonusu veren sitelerstarzbet twittermarsbahisbets10SekabetLisanslı Casino Siteleristake girişmarsbahis telegramMarsbahismarsbahisjojobetholiganbetpusulabetsekabet giriştipobetasyabahistempobetonwin girişsahabetngsbahiselexbetjojobet girişholiganbetonwinonwin girişSekabet güncel girişmaldives casinocasino maldivesmaldives betmaldives online casinomaldives online betcasibomjojobet güncel girişPadişahbet Girişdeneme bonusujojobetarnavutköy escortbeşiktaş escortsisli escortonwinbets10 resmimatbetsavoybettingCasibomPusulabet güncel girişcasibom girişhiltonbetmarsbahisJojobet Girişcasibomromabetcasibommarsbahis güncel girişbets10 güncel girişbets10jojobetdumanbet girişkralbet girişotobetfixbet girişvaycasino güncel girişnakitbahis güncel girişbetciorestbetcasibomgrandpashabetmatadorbetsahabet güncel girişholiganbetmarsbahisonwinsahabetsekabetmarsbahis girişmarsbahiskulisbetbets10marsbahisbetebet girişbetturkeydinamobet girişultrabetdeneme bonusu veren sitelerdeneme bonusu veren sitelercasibom866jojobet girişbets10casibom girişxslotcasibom 866 comJojobet1xbetbetwoonparibahisgalabetjojobet güncel girişjojobet güncel girişjojobetjojobetgrandpashabetjojobetcasinomaximobilbahiscratosslot girişsekabetparibahiskingroyalmarsbahis girişcasinomaxibetturkeydumanbet güncel girişultrabet güncel girişjojobet güncel girişmatbet
casino siteleri canlı casino siteleri 1xbet canlı casino siteleri