0

I have created a custom theme and a custom module. The documentation does not explain enough detail about whether I need a theme or a module or both.

Does a custom theme need a custom module? Do I need both? Can I have a custom module and store the custom theme within the custom modules directory? If I have a custom module does the Magento functions/tools for cart etc. need to be stored within the modules directory?

Any clarification would help as I feel like I am going in circles.

1

Modules are used to add some specific functionality to the store, usually involving PHP classes such as blocks, plugins, and controllers. Themes do not contain PHP classes and thus cannot add functionality.

Themes are used to customize the appearance of the store and contain css rules and media assets. Furthermore, portions of a specific module's code can be modified by the theme layer.

For example, a theme can be used to extend the layout XML files and overwrite the template phtml files that exist in modules. Basically, anything in the view/frontend directory of a module can be overwritten by the theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.