Question

I've got a few questions relating to Magento:

  1. From the Magento Admin Panel page, one can find a list of Magento modules such as Mage_Newsletter and Mage_poll for instance. I would like to know, where do these come from?

    For instance, if I create files such as:

    /var/www/magento/app/design/frontend/[design_package]/[layout_name]/{layout,templates}
    

    What does it take for a module defined by a set of files stored in such a directory to show up on the Magento modules list at the admnistrative page I just pointed out?

  2. Under a design package's skin directory, what is the purpose of having an images directory and then a separate images/media directory. How does one decide what images to put directly under the images directory as opposed to under images/media ? What is the convention used here?

Was it helpful?

Solution

1.Each module has a module registration file.These registration files exists in

app/etc/modules/

and these are used to activate or deactivate the module.For example Mage_Newsletter registration file is Mage_Newsletter.xml

If you want to create a module registration file,create Namespace_Module.xml in app/etc/modules with

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Module>
            <active>true</active>
            </codePool>local</codePool>
        </Namespace_Module>
    </modules>
</config>

This module will appear in admin panel.

2.Catalog,static blocks and images that you upload goes under media.Theme specific images goes under skin/frontend/[design_package]/[layout_name]/images

If you are new to Magento development,you should checkout knowledge base

OTHER TIPS

in magento 2.0 while implementing the custom module we have to define the one file in

app\code\PackageName\Modulename\registration.php

this file should have this code

\Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'PACKAGENAME_MODULENAME', DIR

so when installing the module using 'php bin/magneto setup:upgrade' ..

this file will be invoked and our module data is registered in magento module configuration file

A. Magento 1.9 and its previous versions,

1.The registration file is put in yourRootMagentoDirectory/app/etc/modules folder with name like Mage_All.xml (actually it contains most of the core magento module registration info).This file also have Mage_Newsletter and Mage_poll module information

2.The reason is to saperate the image types Foe example Catalog,static blocks and images that you upload goes under media and theme specific images like logo goes under skin/frontend/[design_package]/[layout_name]/images

B.In magento 2

The registarion file is inside app/code/[CompanyName]/[moduleName]/registarion.php file

These files inform magento that these modules are present and magento load these modules.

And for images related,the answer is same in magento2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top