Posts

Showing posts from May, 2019

Empty Design configuration Issue (We couldn't find any record)

Image
Recently while designing a new theme in magento 2 i had faced a new issue in magento theme design configuration.                   Let me explain the issue in detail. While creating new theme in magento 2 i am unable to see theme configuration records into that table after page rendered. I am attaching a screen shot for better understanding. usually you will see all two Luma and Blank theme entry there along with any other themes if you have made previously. But in my case magento was unable to fetch any one of them. It is rare  but happens with me i i found the solution on  https://github.com/magento/magento2/issues/14600    thanx to the author of this repo who shorted out my issue and save my time and effort in wondering  on web.      The exact problem is due to magento renderer indexer, to short out this issue you need to reset and reindex the all file using below commands. magento indexer:info magento indexer:status magento indexer:reset design_config_grid magento

Directory Structure in magento 2

Magento 2 directory structure are pretty much self explained only by it's name. If you are inside root of your magento project then you would see following directory... /app /bin /dev /generated /lib /pub /var /vendor /app In this folder, you will find following subfolders: /code It includes the Magento 2 core code (One of the locations where you can develop your custom Magento 2 code (custom modules). In some cases, you might not find the core code here. In this case, it’s placed in / vendor/magento  directory . /design This directory has  /adminhtml  and  /frontend  sub-directories which contain theme directories having  phtml, xml, JS  and  LESS files. /etc This directory contains the  di.xml  and  env.php  configuration file, the di.xml file contains class mapping and interface preferences. The env.php file contains the configuration details of your Magento 2. It also contains  config.php  which contains the list of modules, enabled as well as disabled ones.

Creating a new module in magento 2

In magento 2 all modules reside in the folder app/code directory, previously in magento1 there was the concept of local/ community/ core/ folders but that has been removed now. For creating modules in magento 2 we need at least these 3 files in our module in this directory arrangement. Step1 Module names in magento 2 are divided into two part “VendorName_ModuleName” e.g Magento_Contact, Magento_Catalog or Trieffects_Test first part is the vendor and second part is the actual module. Let’s take our module name to be “Trieffects_Hello”. First we need to make the folders app/code/Trieffects/Hello Step2 – module.xml Next we need to add the module.xml file app/code/Trieffects/Hello/etc/module.xml with following contents <?xml version="1.0"?>        <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">         <module name="Trie